3 Replies Latest reply on Mar 18, 2010 4:43 AM by Matthias Preier

    populate array of checkboxes inside rich:columns

    Matthias Preier Newbie

      Hi community,

       

      I'm using Richfaces and Seam for a while now and I encounterd a problem with the new and uncommon tag <rich:columns>. I'm trying render a simple datatable, which has a basic column (name) and a dynamic set of checkboxes. The number of checkboxes depends on an other entity.

       

      <h:form id="exportForm">
           <rich:dataTable id="exportList" var="row" value="#{exportList}">
                <rich:column>
                     <f:facet name="header">Name</f:facet>
                     <h:outputText value="#{row.name}" />
                </rich:column>
                
                <rich:columns value="#{distributorList.resultList}" var="distributor" index="idx">
                     <f:facet name="header">#{distributor.name}</f:facet>
                     <h:selectBooleanCheckbox id="distributor#{idx}" value="#{row.dist[idx]}" />
                </rich:columns>
           </rich:dataTable>
      
           <a4j:commandButton id="exportConfirm"
                type="submit"
                value="Export"
                ajaxSingle="true"
                action="#{export.sendMessage}"
                oncomplete="...hide()" />
      </h:form>
      

       

      Every row contains a Boolean[], which represent the state of the checkboxes. I can easily prefill or just initalize the checkboxes with an init action, but when I submit the form, the new values (based on the user interaction) are not updated in the array. I allways get the old (initalized) values in the sendMessage method.

      I allready looked at the request send to the server and the post data contains the checked boxes, but the bean does not get updated.

       

      Maybe somebody knows what is wrong in my example, because I tryed many things but nothing helped.