Note that there are some explanatory texts on larger screens.

plurals
  1. POwhen i select multiple checkbox in p:datatable selected list is empty
    primarykey
    data
    text
    <p>I have followed this link in using the selection of mutiple values in p:datatable</p> <p><a href="http://www.primefaces.org/showcase/ui/datatableRowSelectionRadioCheckbox.jsf" rel="nofollow">http://www.primefaces.org/showcase/ui/datatableRowSelectionRadioCheckbox.jsf</a></p> <p>Now when i select mutiple values from it and click on the button in my form it should call a method in the bean which is working fine.But the selected values list is empty. I read the posts here and oucld not figure out the solution.I also tried different ways but did not work out.</p> <p>JSF Code:</p> <pre><code>&lt;p:dataTable value="#{deviceController.devicesModel}" var="deviceList" widgetVar="deviceTable" selection="#{deviceController.selectedDevices}&gt; &lt;p:column sortBy="#{deviceList.manufacturerSerialNum}" filterBy="#{deviceList.manufacturerSerialNum}"&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Manufacturer Serial No"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{deviceList.manufacturerSerialNum}" /&gt; &lt;/p:column&gt; &lt;p:column selectionMode="multiple"&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="#{bundle.ListLaptopTitle_inService}"/&gt; &lt;/f:facet&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; &lt;p:commandButton action="#{deviceController.update(deviceController.selectedDevices)}" value="Submit Request" style="margin-top: 20px"/&gt; </code></pre> <p>Code in Bean:</p> <p>public String update(List updateDevice) {</p> <pre><code> try { for(Device d:updateDevice) { getFacade().edit(d); } //message which indiactes device update is successful return "/example.html"; } catch (Exception e) { //handling exception return null; } } </code></pre> <p>So from the page I am passing the value of deviceController.selectedDevices which is empty when checked.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload