-
1. a4j:loadBundle alternative
ilya_shaikovsky Apr 26, 2011 6:46 AM (in response to mano.swerts)try changing language by action using navigation rule this usually helps view to get rebuilt.
-
2. Re: a4j:loadBundle alternative
mano.swerts Apr 26, 2011 7:20 AM (in response to ilya_shaikovsky)Hi Ilya,
Yes I tried that by changing the return type for the setLanguage method on my commandLink to String. It returns null it needs to stay on the same page, but this does not solve the problem.
At the moment I solved it by adding a beforePhase attribute to the f:view tag like this:
{code}
beforePhase="#{loginBean.updateViewRootLanguage}"
{code}
The function in the backing bean looks like this:
{code:java}
public void updateViewRootLanguage(PhaseEvent event) {
if (event.getPhaseId() == PhaseId.RENDER_RESPONSE) {
FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale(getAuthenticatedUser().getLanguage()));
}
}
{code}
This works great, but I don't know if this is a correct way to solve the problem.