Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem while setting default value for h:selectOneMenu  RSS feed

madupathi arun
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}"/>

my currentLanguageResolver is

public List<SelectItem> getPossibleStates() {
RequestLanguageState[] states = RequestLanguageState.values();
List<SelectItem> result = new ArrayList<SelectItem>(states.length);
result.add(new SelectItem("", ""));
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
Boost this thread!