I found a problem in my application when I needed to change the language of my login page . My managed bean is:
@ManagedBean(name="langueApp")
@SessionScoped
public class LangueApp {
public String activerFR() {
FacesContext context = FacesContext.getCurrentInstance();
context.getViewRoot().setLocale(Locale.FRENCH);
return null;
}
public String activerEN() {
FacesContext context = FacesContext.getCurrentInstance();
context.getViewRoot().setLocale(Locale.ENGLISH);
return null;
}
and in my login page the code related to the change of language is :
<p:commandLink ajax="false" value="#{langueApp.activerFR()}" immediate="true"><p:graphicImage library="images" name="francais.jpg" style="border:0px"/>
</p:commandLink>
Same thing for english.
The problem is when executing and clicking on the image to change the language everything works fine but when re-clicking on the previous image no change is occured , the language don't change, is there any solution for this ?