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
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
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
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
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
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
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
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
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);
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
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.
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
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
13 matches
Mail list logo