4 Replies Latest reply on Jun 10, 2008 6:55 AM by ilya_shaikovsky

    selectManyCheckbox doesn't update the back bean using a4jsup

    fabboco

      Hi,

      I have detected a strange behavior of selectManyCheckbox and a4j:support.

      I have this in my form

      .....
      <h:selectManyCheckbox required="true" id="getE2s" value="#{e1.e2s}" rendered="true" >
       <s:selectItems value="#{E2Manager.getSelectionItems(true,e1,'getE2s')}" var="e2" label="#{e2.p2}" />
       <s:convertEntity />
       <a4j:support event="onchange" reRender="altroE2" ajaxSingle="true" limitToList="true" />
      </h:selectManyCheckbox>
      .....
      <h:inputText id="altroE2" value="#{e1.altroE2}" required="#{true and e1Operation!='DELETE'}" disabled="..." >
      


      where e1.e2s represents a 1:N relationship.

      I am using Seam 2.0.2.SP1 and RichFaces 3.2.1.GA.

      My objective is enabling and disabling the input text when the checkbox changes (rules are not relevant for this discussion).

      Each time one checkbox is either selected or deselected the e1's following public method is called (via ajax request) and the relationship is updated.

       public void setE2s(List<E2> e2s)
      


      Now, the strange behavior. When the LAST checkbox is deselected the setE2s(...) is not called and the relationship is not updated. For this reason the inputText (id=altroE2) is not properly enabled / disabled.

      Is this a bug ? Is there any workaround ?

      Regards

      Fab.