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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -