Re: Wicket localization in stateful pages

2013-11-17 Thread meduolis
Thanks for help, I used this example to make localization work as I wanted: http://www.wicket-library.com/wicket-examples-6.0.x/pub/?0 It does not reload page after setting new locale, so no new page version is created and when you navigate back, using browser, locale stays the same. Also I had

Re: Wicket localization in stateful pages

2013-11-13 Thread Martin Grigorov
So I tried to pass it using page parameters. Also, I have updated dynamic label model to LoadableDetachableModel. This is an option for you. See http://www.wicket-library.com/wicket-examples-6.0.x/mappers/en_US There are three links (EN, DE and BG). The demo uses LocaleFirstMapper to set the

Re: Wicket localization in stateful pages

2013-11-12 Thread Martin Grigorov
On Mon, Nov 11, 2013 at 7:02 PM, meduolis meduol...@gmail.com wrote: Storing it in page will not work as it will reset each time I call setResponsePage. Storing it in data base will not work also, because locale will became global for all visitors. So I tried to pass it using page

Re: Wicket localization in stateful pages

2013-11-12 Thread meduolis
Those are screenshots taken from quickstart project I have provided: 1. (0 page version) We enter the page. Default locale is EN. Everything are localized in english because locale is correct for all components http://apache-wicket.1842946.n4.nabble.com/file/n4662342/1-enterTheSite.jpg 2. (1

Re: Wicket localization in stateful pages

2013-11-11 Thread Sven Meier
The back-button brings you back to the previous state of the component tree. If your page is depending on external state (e.g. session or database content) for rendering, it will of course show the most recent data wherever you have told it so (by using a model). Regards Sven On 11/10/2013

Re: Wicket localization in stateful pages

2013-11-11 Thread Martin Grigorov
Hi, As Sven explained 2. new Label(contentNoModel, resolveLocalizedContent()); doesn't use dynamic model (a model that will re-calculate its object/value on each request). It initializes the value of the label at construction time and from there on this value doesn't change. See

Re: Wicket localization in stateful pages

2013-11-11 Thread meduolis
Hi Martin, so, if I want browser back action to show the same result, I have to choose between components with static models or components with dynamic models only? Because if I use different types I will get different results when backing to older page version? I am really not getting the thing

Re: Wicket localization in stateful pages

2013-11-11 Thread Martin Grigorov
Hi meduolis, I hope you know what http session is. It doesn't matter how you get to a page (via a normal (forward) link or via back button), when you read an attribute value from the session it will be the same. In your case the dynamic models use the session's locale to decide which i18n

Re: Wicket localization in stateful pages

2013-11-11 Thread meduolis
So, back button does not restore locale value in session? Ok, I will be more specific: *action 1.* I click link switchLanguageToEN; (VERSION 1) (both labels (with static and dynamic models) updates to english); *action 2.* I click link switchLanguageToDE; (VERSION 2)(... updates to german);

Re: Wicket localization in stateful pages

2013-11-11 Thread Sven Meier
Is there a way to restore locale for dynamic models when navigating between page versions? Whenever the locale is changed, put it in the session and store it in the page too. Override #getLocale() and return whatever is stored as the page's locale. Sven On 11/11/2013 04:24 PM, meduolis

Re: Wicket localization in stateful pages

2013-11-11 Thread meduolis
Storing it in page will not work as it will reset each time I call setResponsePage. Storing it in data base will not work also, because locale will became global for all visitors. So I tried to pass it using page parameters. Also, I have updated dynamic label model to LoadableDetachableModel.

Wicket localization in stateful pages

2013-11-10 Thread meduolis
-- 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

Re: Wicket localization in stateful pages

2013-11-10 Thread Sven Meier
.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

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