Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to reset to default value a <h:selectOneMenu> component?

843844Sep 24 2008 — edited Feb 11 2009
dear all,

I have a drop down list in my application linked with another.
I would like to reset to the default value the second drop down list according to the value selected in the first drop down.

Here first drop down with its valueChangeListener
	<h:selectOneMenu  id="idSourcingType"   valueChangeListener="#{sourcingTypeController.selectInputValueChanged}" 
		value="...."> 					
			<f:selectItems    id="SlctSourcingTypeItms" value="#{applicationDefaultDataController.allSourcingTypes}"/>		
		</h:selectOneMenu>
Here the second drop down to reset to default value
	<h:selectOneMenu  id="idEventCountry"   binding="#{sourcingTypeController.eventCoutriesComponent}"> 	 
    				<f:selectItems    id="SlctEventCountryItms" value="#{applicationDefaultDataController.eventCountries}"/>		
		</h:selectOneMenu>
The problem is there is no link between my two classes: sourcingTypeController and applicationDefaultDataController.
I can access to the applicationDefaultDataController.eventCountries.
The applicationDefaultDataController is a backing bean in session scope use to fill all componants of the application.

I try by using the binding like following:
SelectItem[] eventCountriesArray = this.eventCoutriesComponent.getSelectItems();	
but I have no way to set the SelectItem[] updated.
Any idea? Any advice?

Edited by: eliselavy on Sep 24, 2008 8:47 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 11 2009
Added on Sep 24 2008
10 comments
960 views