-
1. Re: localeSelector.select()
christine1 May 27, 2010 3:12 PM (in response to christine1)Er, I still have this question.
-
-
3. Re: localeSelector.select()
kragoth Jun 22, 2010 1:20 AM (in response to christine1)This has nothing to do with Seam but rather how JSF works.
You really should take the time to read some more about JSF especially around navigation outcomes to help you understand this particular issue.
But, for anyone else that comes along and reads this while trying to work out their own problems I will try to give a quick and dirty explanation of what is going on.
Remember this is a quick and dirty explanation and does not completely reflect how JSF works.
Essentially before JSF renders a page as html it builds up a component tree we'll call it a View. This View is a tree that describes the page at a component level in a heirachical way. Once this tree is built then the render phase essentially walks down this tree and spits out html.
This View is NOT discarded after the page is rendered. So, if in the application invoke stage of your next request/post your navigation outcome is NULL or VOID the EXISTING View is used during the render response phase.
So, even though during your application invoke phase you updated some data that should have changed your web page it wasn't actually updaged because you essentially told JSF to not bother building a new page because your method is a void return type.
A simple fix to your problem would be to change your method to return a blank String.
public String select() { Locale locale = localeSelector.getLocale(); if (profile != null) { profile.setLocale(locale); profile.setLanguageCode(locale.getLanguage()); profileDao.merge(profile); } localeSelector.select(); return ""; }
Doing this should force JSF to build a new page.
This tutorial mentions the concept. I was looking for a better tutorial but couldn't find it.
Please remember that this is not exactly how it all works but a simplified explanation.
Hope it helps you.
Tim -
4. Re: localeSelector.select()
kragoth Jun 22, 2010 2:07 AM (in response to christine1)I keep thinking I'm forgetting something very important about what I've just said so... If it doesn't work for you let me know. :)
Something is bugging me about the blank string idea and I can't remember what it is.
-
5. Re: localeSelector.select()
christine1 Jul 19, 2010 7:45 AM (in response to christine1)Tim, thank you for the reply...