wood burning stoves 2.0*
The moose likes JSF and the fly likes problem while setting default value for h:selectOneMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "problem while setting default value for h:selectOneMenu" Watch "problem while setting default value for h:selectOneMenu" New topic
Author

problem while setting default value for h:selectOneMenu

madupathi arun
Greenhorn

Joined: Feb 25, 2008
Posts: 23
hi yaji
I am unable to set the default value for h:selectOneMenu

my jsf is

<h:selectOneMenu id="requestStatus12" value="#{currentLanguageResolver.requestState}" onchange="submit()" valueChangeListener="#{currentLanguageResolver.valueChangeSelectOneMenu}">

<f:selectItems value="#{currentLanguageResolver.possibleStates}"/>
</h:selectOneMenu>

my currentLanguageResolver is
==========================

public List<SelectItem> getPossibleStates() {
RequestLanguageState[] states = RequestLanguageState.values();
List<SelectItem> result = new ArrayList<SelectItem>(states.length);
result.add(new SelectItem("", ""));
myMap.clear();
for (RequestLanguageState state : states) {
myMap.put(state.toString(), state);
// result.add(new SelectItem(state, new I18n(state.toString()).getDefault()));
result.add(new SelectItem(state.toString(), new I18n(state.toString()).getDefault()));
}
return result;
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem while setting default value for h:selectOneMenu
 
Similar Threads
How to set default selection for selectOneMenu?
Bean Value is always Null
List<SelectItem> sort
Linking selectItem in loop with list not from backing bean
SelectItem Help needed