-
1. Re: Simple Form
ilya_shaikovsky Feb 9, 2010 5:08 AM (in response to xlugo)1 of 1 people found this helpfulyou should remvoe region around the button - it's limits processing to just button.
And b.t.w if you even stucked with 3.1.x because of environment requirements - it's highly recommended to use 3.1.6 which is the latest and more stable version.
-
2. Re: Simple Form
xlugo Feb 16, 2010 8:04 PM (in response to ilya_shaikovsky)Let me try it, thank you very much-
I have this code:
<h:form>
<a4j:region id="region1">
<h:selectOneMenu value="#{myBean.selectedCountry}" id="countries" >
<f:selectItems value="#{myBean.listCountries}" />
<a4j:support actionListener="#{myBean.countryChanged}" event="onchange" reRender="states" />
<h:outputLabel value="Countries:" for="countries"/>
</h:selectOneMenu>
</a4j:region>
<a4j:region id="region2">
<h:selectManyListbox id="states" value="#{myBean.selectedListStates}">
<f:selectItems value="#{myBean.listStates}"/>
<h:outputLabel value="States:" for="states"/>
</h:selectManyListbox>
</a4j:region><a4j:commandButton actionListener="#{myBean.showValues}" reRender="country" value="execute" >
</a4j:commandButton><a4j:region id="region3">
<h:outputText value="#{myBean.selectedCountry2}" id="country"/>
</a4j:region>I want to read the selectedCountry value (and selectedListStates)
my bean:
// private selectedCountry, selectedCountry2
//get and set methods ...
public void showValues(ActionEvent event){
this.selectedCountry2 = this.selectedCountry;
}If I just select a item from selectOneMenu I get the correct value; but when I select a item from selectManyListBox I get a blank value.
<managed-bean>
<managed-bean-name>myBean</managed-bean-name>
<managed-bean-class>package.MyBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>