Selected messages in a JSF dataTable don't get updated as selected in Java -


so have problem: have datatable being generated in jsf using list bean of corresponding xhtml page. datatable , column checkboxes select messages looks this:

<t:datatable binding="#{table}" rendered="#{searcharhivauibean.rendertable}" value="#{searcharhivauibean.nonediabstractlist}" var="dataitem" border="0" cellspacing="2" width="100%" id="tdtbl" rows="#{searcharhivauibean.numberofrows}" headerclass="tableheader" rowclasses="rowodd,roweven" columnclasses="column">  <h:column>     <f:facet name="header">         <h:selectbooleancheckbox id="selectallcheckbox" onclick="togglecheckbox(this.id,'form2:tdtbl')"          value="#{searcharhivauibean.selectallcheckbox}"/>     </f:facet>     <t:panelgroup>         <h:selectbooleancheckbox value="#{dataitem.selectat}"/>     </t:panelgroup> </h:column> 

in java file, try selected items datatable , use them generate files (an archive) ones selected. problem - none of them selected. if run loop see ones selected check checkboxes in interface , press button download generated archive, messages have boolean value of "selected", getter method "isselected()" set false.

here's of java code:

try {         // lista documente de pus in zip         map<string, byte[]> fisiere = new hashmap<>();         file filezip = null;          if (tipmesaj.equals(tipmsg6char.orders)) {              system.out.println(formatulmesajului);              filezip = new file("lista_de_comenzi.zip");              (int = startindex; < endindex; i++){                 system.out.println(nonediabstractlist.get(i).isselectat());             }              (int = startindex; < endindex; i++) {                  nonediorder msg = (nonediorder) nonediabstractlist.get(i);                 system.out.println("am trecut peste lista " + i);                 if (msg.isselectat()){...} 

basically, first loop display "false" elements, , if(msg.isselectat()) never execute because isselectat returns false elements.

how can make behavior of checking checkboxes set value of "selectat" true, when use "isselectat()" each object, return true ones i've checked in interface?

thanks!


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -