Table disappears when using selectionMode="single" in PrimeFaces -
i have commandbutton
<p:commandbutton value="#{bundle.add}" icon="ui-icon-plus" actionlistener="#{fapurmb.setfainfototable}" style="width:100px;" update=":messagegrowl, fsfainfo, tblassetlist" process="@this, fsfainfo"> <p:resetinput target="fsfainfo" /> </p:commandbutton>
and datatable
<p:datatable id="tblassetlist" value="#{fapurmb.fainfolist}" selectionmode="single" var="falist" rowindexvar="rowsn" scrollable="true" rows="10" paginator="true" rowsperpagetemplate="10,20,50,100" > </p:datatable>
when omit selectionmode="single", data added fine. however, when include it, row disappears after clicking add.
what wrong code?
you need set rowkey attribute table componet. example:
<p:datatable id="tblassetlist" value="#{fapurmb.fainfolist}" selectionmode="single" var="falist" rowkey="#{falist.id}" ...>
Comments
Post a Comment