0 Replies Latest reply on Mar 12, 2008 8:58 AM by Magnus Sandberg

    f:selectItems not updated on reRender

    Magnus Sandberg Novice

      (This is more or less the same as a previous post http://jboss.com/index.html?module=bb&op=viewtopic&t=129868)

      I have a backing bean with a list of items for a select one meny and a button, when submitted items are removed or added from the list of availible selections.

      The xhtml looks like this:

       <h:form>
       <a4j:region>
       <rich:dataTable id="table" .... />
       <h:selectOneMenu id="list" value="#{edit.value}" required="true">
       <h:selectItems value="#{edit.values}" />
       </h:selectOneMenu>
       <a4j:commandLink
       action="#{edit.addItem}"
       reRender="table"/>
       </a4j:region>
       </h:form>
      


      when doing like this the items in the menu are not updated from the backing bean in the render response phase and the page ends up with the wrong values.

      But if I add an explicit reRender of the selectOneMenu:

       <h:form>
       <a4j:region>
       <rich:dataTable id="table" .... />
       <h:selectOneMenu id="list" value="#{edit.value}" required="true">
       <h:selectItems value="#{edit.values}" />
       </h:selectOneMenu>
       <a4j:commandLink
       action="#{edit.addItem}"
       reRender="table,list"/>
       </a4j:region>
       </h:form>
      


      the values are fetched from the backing bean and the correct values are shown on the page.

      Is this really a correct behaviour or am I missing something?

      /Magnus