Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem while setting default value for h:selectOneMenu

 
madupathi arun
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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;
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic