I'm implementing a multilanguage page which allow use to select their desire language. I have implemented something like this and everything work perfectly. JSF 2.0 set locale throughout session from browser and programmatically
However, when I click to change my language, the whole page is refreshed and the locale for all the text is changed, but the text i input in the form also gone. Example: 1. I have locale in English and got a form with input Username 2. I enter "ABC" in username 3. I click on the change language link to Chinese language 4. Username become Chinese word 5. "ABC" I entered previously is gone.
Is it possible to change the language and in the same time preserving my input? I tried use ajax but similar issue happen. I need to use @all as I got menu, footer and other text which is not in the form to be translated.
Sample of my code:
<h:commandLink immediate="true" value="#{msg[localeType.resourceKey]}"
rendered="#{languageBean.isCurrentLocale(localeType.value) == false}">
<f:ajax render="label" execute="@all"
listener="#{customerDetailBean.preserveFormData(localeType.value)}"/>
</h:commandLink>
Thanks in advance for the great help.