Thanks for the response!

"Welcome to the Tapestry world! :)"

My pleasure! The Framework is great! ;)

Here's what I'm trying to do... In the Top of my page there will be a sequence 
of flags (the countries related to the supported languages of the app). Except 
for the Flag of the current country/language, all of them will be inside a 
<t:actionLink /> component to change the current Locale. The flag of the 
current country/language will not be inside a ActionLink, so only will be shown 
as it's "disabled version" (the same flag in black/white colors - another 
image).

So, one of my problems is (was, after your answer :)) to retrieve the 
information of the Supported Languages in Runtime, and render it in the page 
(Layout component, to tell the truth) as a Sequence of flags enabling Language 
Change.

If my problem was to show the Image of the current country/language, it would 
be easy as you said...

Thanks for the Symbol value retrieving example!! I'll try here. :)




________________________________
De: Thiago H. de Paula Figueiredo <thiag...@gmail.com>
Para: Tapestry users <users@tapestry.apache.org>
Enviadas: Terça-feira, 17 de Novembro de 2009 15:39:32
Assunto: Re: Dynamic Locale changing

Em Tue, 17 Nov 2009 13:46:12 -0200, Everton Agner <everton_ag...@yahoo.com.br> 
escreveu:

> To begin with... I am learning Tapestry from 1 month ago.

Welcome to the Tapestry world! :)

> @Inject
> @Property
> @Path("context:/layout/images/brazil.png")
> private Asset flagBrazil;

You're doing it in a way more complex that it needs to be. All you need to do 
is to refer to your asset and the Tapestry automatically searches for the 
localized version. Example:

@Inject
@Property
@Path("context:/layout/images/flag.png")
private Asset flag;

If the current locale is pt_BR, Tapestry will try to find 
/layout/images/flag_pt_BR.png in your context. If it's found, it will be used. 
;)

> So... The first thing I'm having problems with is to retrieve in Runtime the 
> information stored on the AppModule class (contributeApplicationDefaults 
> method). There is a way I can do this?

Suppose you need to know the value of the tapestry.production-mode symbol. You 
can inject it in your component or page class:

@Inject
@Symbol("tapestry.production-mode")
private boolean productionMode;

> The second problem I'm having is to retrieve the Assets (the images) in a 
> Dynamic way (knowing the Locale name and if it's the enabled/disabled 
> image)... I've read about AssetFactory, but didn't find any good example 
> related.

You don't need to use AssetFactory to do that. Just name the assets 
appropriately. ;)



      
____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Reply via email to