• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[JSF 2] internationalization: UPDATE_MODEL_VALUES et INVOKE_APPLICATION phases are skipped

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have this <h:selectOneMenu> tag where the user can change the language.


Here is the method of the managed bean :




The method is called but the values of the current view are not updated. They are updated if i refresh the page.
Here are the sequence of phases calls :
1) User changes the language :


2) User refreshes the page :


Obviously, the UPDATE_MODEL_VALUES et INVOKE_APPLICATION phases are skipped.

Question : why are they skipped and how can i call them ?
Well I did manage to call these 2 phases with these 2 lines :
event.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
event.queue();
In that case all phases are called. Still, I need to refresh the page to get the chosen language.

Thanks in advance for helping.
 
Ed Burns
author
Ranch Hand
Posts: 82
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think a better way to do it would be to use the "locale" property of
<f:view>, like this:

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

Then have the getter do whatever you need to do to look it up.

Would that work?

Ed

P.S. On 2 February, here on JavaRanch, I'm doing an event to promote my
new book, JavaServer Faces 2.0: the Complete Reference. Stay tuned for
details!

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well,
I already have that property set on the view. And the getter/setter on the bean.

I did as you suggested though and modified the locale in the getter :



I can see that it goes through all the phases but I still need to refresh the page to get the new values (different language).

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic