webtier@glassfish.java.net

JSF 2.0: locale change only after page refresh

From: <webtier_at_javadesktop.org>
Date: Tue, 12 Jan 2010 05:35:15 PST

Hi!

I'm upgrading a small (working) programme from JSF 1.2 and JSP to JSF 2.0 and Facelets.

My problem is that locale change which is referenced on the Facelet page as

<f:view locale="#{bean.userLocale}">

works only after the page is manually refreshed (after the locale change form has been submitted).

I have tried various methods with no success yet:
- form button with immediate="true" and context.getViewRoot().setLocale(new Locale("xx", "YY")) in managed bean code
- normal form without immediate="true"
- an ajax button with <f:ajax execute="userLocale" render="@all"/>

Googling for this turned up a couple of similar problems but no working solutions.
[Message sent by forum member 'napu' (panu.korpela_at_fcspartners.fi)]

http://forums.java.net/jive/thread.jspa?messageID=380291