You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by hrbaer <he...@gmail.com> on 2011/04/02 00:20:34 UTC

changing image on locale change

Hi all,

is there any chance to change an image once the user choose another
language?
With a text it's very easy because the only thing you have to provide are
the different language property files.

Let's assume there is a dropdown with different languages. I've added
DropDownChoices and implemented the onSelectionChanged method. If the user
choose another option the only thing I have to do is to set the Locale to
the choosen language.

Is there a similar functionality for images?

At the moment I've tried a little bit with this:
------------------
Image imageGerman = new Image( "someImage", new ResourceReference(
Home.class, "images/logo.png" ) );
Image imageUK = new Image( "someImage", new ResourceReference( Home.class,
"images/logo2.png" ) );
add( isLocaleGerman() ? imageGerman : imageUK );
------------------
But this is only working if the page constructor is called.

Any ideas?
Thanks in advance.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/changing-image-on-locale-change-tp3421291p3421291.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: changing image on locale change

Posted by hrbaer <he...@gmail.com>.
Thanks Igor.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/changing-image-on-locale-change-tp3421291p3421371.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: changing image on locale change

Posted by Igor Vaynberg <ig...@gmail.com>.
There is a locale pub example in wicket-examples that shows how to do it.

-igor
On Apr 1, 2011 3:21 PM, "hrbaer" <he...@gmail.com> wrote:
> Hi all,
>
> is there any chance to change an image once the user choose another
> language?
> With a text it's very easy because the only thing you have to provide are
> the different language property files.
>
> Let's assume there is a dropdown with different languages. I've added
> DropDownChoices and implemented the onSelectionChanged method. If the user
> choose another option the only thing I have to do is to set the Locale to
> the choosen language.
>
> Is there a similar functionality for images?
>
> At the moment I've tried a little bit with this:
> ------------------
> Image imageGerman = new Image( "someImage", new ResourceReference(
> Home.class, "images/logo.png" ) );
> Image imageUK = new Image( "someImage", new ResourceReference( Home.class,
> "images/logo2.png" ) );
> add( isLocaleGerman() ? imageGerman : imageUK );
> ------------------
> But this is only working if the page constructor is called.
>
> Any ideas?
> Thanks in advance.
>
> --
> View this message in context:
http://apache-wicket.1842946.n4.nabble.com/changing-image-on-locale-change-tp3421291p3421291.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>