You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kris Rasmussen <kr...@yahoo.com> on 2004/02/18 06:19:16 UTC

global assets

Is there a way to specify an asset in only one file and then reference it with something like ognl:global.assets.myasset.
 
I wrote a generic errorform component that takes an error image as a parameter in a library I wrote and I would like an application I am writting to use the same error image everytime without having to create a .page just to specifiy the asset. I realize I could create a new component like myerrorform that simply passes its bindings to the errorform component and the error image, but that seems like overkill.
 
Kris


---------------------------------
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.

Re: global assets

Posted by John Rubier <in...@insurgent.us>.
* Kris Rasmussen <kr...@yahoo.com> [2004-02-17 21:19:16 -0800]:

> Is there a way to specify an asset in only one file and then reference it with something like ognl:global.assets.myasset.
>  
> I wrote a generic errorform component that takes an error image as a parameter in a library I wrote and I would like an application I am writting to use the same error image everytime without having to create a .page just to specifiy the asset. I realize I could create a new component like myerrorform that simply passes its bindings to the errorform component and the error image, but that seems like overkill.
>  
> Kris
> 
Hi Kris,
You could make a page specification with all your assets declared in it and reference them like this:
ognl:page.requestCycle.getPage('assetPage').assets.assetName

No idea as to performance or scalability issues for doing it like this. Likely the gurus on the list will be able to provide
a better solution, maybe something involving the asset service.

Take care,

John

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org