0 Replies Latest reply on Jun 21, 2012 5:39 PM by fabiogsilva

    RichFaces: additems event bound to pickList component does not submit updated values

    fabiogsilva

      I created a view with two pickLists components as follows:

       

      <rich:pickList id="teams" value="#{myBean.teamsValues}">
           <f:selectItems value="#{myBean.allTeams}" />
           <f:convertNumber integerOnly="true" />
           <a4j:ajax event="additems" execute="@this" render="members" />
      </rich:pickList>
      
      <rich:pickList id="members" value="#{myBean.membersValues}">
           <f:selectItems value="#{myBean.allMembers}" />
           <f:convertNumber integerOnly="true" />
      </rich:pickList>
      

       

      The second pickList is populated based on the values selected in the first one. So, when the first list changes, I expect the new values to be submitted to the bean and the second list to be repopulated and rerendered.

       

      The problem is: the "additems" event from the first pickList does not submit the updated values to the bean, but the old ones instead.

       

      I found out that if I use the "targetblur" event instead, the component do submit the updated values. Also, by manipulating the javascript, I found that if a delay is inserted before the Ajax request is submitted, then the correct values are sent to the server. It seems like the "additems" event is being called too early.

       

      Am I missing something, or is this a bug?

       

      The environment is:

      JSF 2.1.9 (Mojarra)

      RichFaces 4.2.2.Final

      JBoss AS 6.1.0.Final