I have two comboboxes, the selection of the first one has to define the
subset of the available selections for the second one.

First Combo
-----------------
<tr:selectOneChoice label="FirstCombo:" value="#{myBacking.myValue01}"
valueChangeListener="#{myBacking.myListener}" required="true"
immediate="true" autoSubmit="true">
                        <f:selectItems value="#{myBacking.items01List}"
binding="#{myBacking.items01List}"/>
</tr:selectOneChoice>


Backing Bean
--------------------
private UIXSelectOne secondCombo;
private UISelectItems items01List;
private UISelectItems items02List;

public void myListener(ValueChangeEvent event) {
        String newValue = event.getNewValue();

        ... logic to fill items02List with the subset of needed values.

        items02List.setValue(values);


RequestContext.getCurrentInstance().addPartialTarget(this.getSecondCombo());
        getSecondCombo().setSubmittedValue(null);
        getSecondCombo().setValue(null);
        getSecondCombo().setLocalValueSet(false);
}

Second Combo
----------------------
<tr:selectOneChoice label="Second Combo" value="#{myBacking.myValue02}"
binding="#{myBacking.secondCombo}" required="true">
                      <f:selectItems value="#{myBacking.items02List}"
binding="#{myBacking.items02List}"/>
</tr:selectOneChoice>




with debugging I can see that the listener get's called and the correct
values are available in items02List, also getItems02List() get's called. But
the values never show up in the second <tr:selectOneChoice> I may do
something wrong or just need a refresh..?

Thanks
Bastian

Reply via email to