Wicket localization in stateful pages

2013-11-10 Thread meduolis
I have noticed that localization does not work for wicket when pages
versioning happens.

Let say I have three components in my page:
1. wicket:message key=localizedResouceKey /
2. new Label(contentNoModel, resolveLocalizedContent());
3. new Label(contentWithModel , new Model() { getObect() {return
resolveLocalizedContent()}});

and also I have two links, which allows me to switch between two locales;

So, I enter the page and click between locale links many times. Then I click
back button several times.

Components 1. and 3. never gets localized, only component 2. which does not
use model got localized.

It looks like when older page version loads model does not update with new
locale value.

Is this a bug or expected behavior?

Quickstart project where we can reproduce specified behavior:
versionLocale.zip
http://apache-wicket.1842946.n4.nabble.com/file/n4662260/versionLocale.zip  






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-localization-in-stateful-pages-tp4662260.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket localization in stateful pages

2013-11-10 Thread Sven Meier

Hi,

your quickstart works fine:

When you press the back button, the locale in the session stays on its 
last selection. Thus the dynamic localization in 1 and 3 stays on the 
current locale, while 2 show the previous locale, which was selected 
when the component was constructed.


Regards
Sven

On 11/10/2013 01:22 PM, meduolis wrote:

I have noticed that localization does not work for wicket when pages
versioning happens.

Let say I have three components in my page:
1. wicket:message key=localizedResouceKey /
2. new Label(contentNoModel, resolveLocalizedContent());
3. new Label(contentWithModel , new Model() { getObect() {return
resolveLocalizedContent()}});

and also I have two links, which allows me to switch between two locales;

So, I enter the page and click between locale links many times. Then I click
back button several times.

Components 1. and 3. never gets localized, only component 2. which does not
use model got localized.

It looks like when older page version loads model does not update with new
locale value.

Is this a bug or expected behavior?

Quickstart project where we can reproduce specified behavior:
versionLocale.zip
http://apache-wicket.1842946.n4.nabble.com/file/n4662260/versionLocale.zip






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-localization-in-stateful-pages-tp4662260.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket localization in stateful pages

2013-11-10 Thread meduolis
Exactly, I am really confused now. As I understand from your answer - this is
expected behavior. 
I thought that back action should behave exactly the same when you
navigating the site using wicket controls.
Should I override back action somehow and do it myself?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Back-button-issue-when-localizing-in-stateful-pages-tp4662260p4662262.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org