• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 82
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).

 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic