I have the following link in my html tapestry page
<div t:id="englishLocaleLink" t:type="ActionLink">English</div>

and the following method in the corresponding Java Class but it doesn't get
called when the above link is clicked
        @OnEvent(value = "action", component = "englishLocaleLink")
        Object onActionFromEnglishLocaleLink(@InjectService("ThreadLocale")
ThreadLocale threadLocale)
        {               
                threadLocale.setLocale(new Locale("en"));
                return null;
        }

If I remove the ThreadLocale parameter the method gets called but obviously
the locale is not changed. 
Is the above the correct way to inject the ThreadLocale service in my page?
If yes then how can I force the above method to be called and consequently
change the locale. 

Thanks,
Petros


Howard Lewis Ship wrote:
> 
> I think that comment is out of date.
> 
> You should be able to inject the ThreadLocale service and change the
> locale there.  Tapestry will pick up on that and write out an updated
> cookie, which will cause the subsequent render request to be in the
> new locale.
> 
> On 3/9/07, Bogdan Calmac <[EMAIL PROTECTED]> wrote:
>> Thanks guys, I saw that, but there was no mention about the ability to
>> change the locale at application level. So I can assume that for my
>> use case I would inject a new service in my page and use it to change
>> the locale programatically?
>>
>> Thanks,
>>
>> Bogdan Calmac.
>>
>> On 3/9/07, Hugo Palma <[EMAIL PROTECTED]> wrote:
>> > Take a look at the bottom of this page
>> >
>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html.
>> >
>> > /"Tapestry does not yet support changing the locale, but that will be
>> > available shortly."/
>> >
>> > Bogdan Calmac wrote:
>> > > Is it possible in Tapestry 5 to programatically change the locale for
>> > > a sesison similar to IEngine.setLocale() from Tapestry 4?
>> > >
>> > > In my case I want to set the locale after the login into the
>> > > application (locale is stored in the user profile) and not rely on
>> the
>> > > browser locale.
>> > >
>> > > Thank you,
>> > >
>> > > Bogdan Calmac.
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > > For additional commands, e-mail: [EMAIL PROTECTED]
>> > >
>> > >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
> 
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5---Changing-Locale-tf3376399.html#a10414090
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to