Hi,

I did this:

Java:

    @Inject
    private AssetSource assetSource;

    public List<Language> getLanguages(){
        return parameterManager.getLanguages();
    }
    
    @Property
    private Language language;

    public String getLanguageAsset(){
        Asset asset = assetSource.getAsset(null, "context:/assets/images
/"+language.getLanguage()+".gif", null);
        return asset.toClientURL();
    }

.tml

    <t:loop t:source="languages" t:value="language">
        <imgtag class="language_flag" alt="${language.displayName}"
src="${languageAsset}"/>
    </t:loop>

change imgtag -> img


Inge Solvoll-2 wrote:
> 
> Hi!
> 
> I would like to do something like this, but this syntax obviously doesn't
> work. The ${bannerPath} seems to be pointing to a "symbol", which
> obviously
> isn't a page property.
> Is there a similar way to do this?
> 
>   @Inject
>   @Path("${bannerPath}")
>   private Asset banner;
> 
> 
>   public String getBannerPath() {
>     return "context:/company/1/banner.gif";
>   }
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Dynamic-asset-path-tp18851298p18851830.html
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