You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by sj...@stradefi.com on 2006/06/02 17:03:09 UTC
Locale
Hello!
Could someone help me: I want in my jsp page a menu to select the language
of the page. For that I was doing this:
<h:selectOneMenu id="langs" style="width:150px" value="#{EF_JspWizard.lang}"
onchange="#{EF.changeLang}" immediate="false">
<f:selectItems value="#{EF_JspWizard.listLang}" />
</h:selectOneMenu>
Where EF_JspWizard is my class where I stored the list of languages
(listLang) and where I get back the selected language (lang). So if this
selection change I want to change the language of the page calling my
function changeLang():
public void changeLang()
{
FacesContext fc = FacesContext.getCurrentInstance();
// set locale for JSF framework usage
Locale loc = new Locale(this.lang);
fc.getViewRoot().setLocale(loc);
}
But the lang cannot be get like this. How could I resolve my problem?
Thanks