0 Replies Latest reply on Aug 9, 2007 2:55 PM by Sheldon s

    help on selection box

    Sheldon s Newbie

      I have a top level selection box and a second level selection box. The values of the second level selection depend on top level selection. I am using Seam 2.0.0 beta 1 and ajax4jsf 1.1.1. I add an onChange event to the top level selection box to re-render the second level selection box. My problem is that when I change the value of the top selection, my second level values always correspond to the top level before the change. I did a debug, it seems the re-rendering happens before the model gets updated. Why is that? Here is the code:

       <s:decorate id="topCategoryDecoration" template="WEB-INF/layout/edit.xhtml">
       <ui:define name="label">Category</ui:define>
       <h:selectOneMenu id="topCategory"
       <s:selectItems id="topCategorySelectItems" value="#{topBusinessCategories}"
       var="cat" label="#{cat.topLevel}" noSelectionLabel="Please Select ..."
       hideNoSelectionLabel="true" />
       <a:support event="onchange" reRender="subCategoryDecoration"/>
       <s:decorate id="subCategoryDecoration" template="WEB-INF/layout/edit.xhtml">
       <h:selectOneMenu id="subCategory"
       rendered="#{bc.topCategory != null}">
       <s:selectItems id="subCategorySelectItems"
       var="subCat" label="#{subCat.secondLevel}"/>