Hi.

We did sth like this in our app. 
1. Define a component containing all your assets, e.g:

<component-specification 
    class="bla.blub.AllAssets"
    allow-body="no" allow-informal-parameters="no">

  <description>
  Assets
  </description>
  
    <context-asset name="empty" path="/images/pxt.gif"/>
    <context-asset name="unknown" path="/images/icons/UNKNOWN_TYPE16x16.gif"/>
    <context-asset name="document" 
path="/images/icons/DOCVERSION_16_16_256.gif"/>
    <context-asset name="message" path="/images/icons/MESSAGE_16_16_256.gif"/>

</component-specification>

2. in any template include the component
<span jwcid="[EMAIL PROTECTED]"/>

3. in your page class implement method like this

    public IAsset getIcon(name) {

        return ((AllAssets) getComponent("allAssets")).getAsset(name);
    }

4. whenever you need an asset
<img jwcid="@Image" image="ognl:icon('document')"/>

Step 3 is for convenience reasons only. You could also do step 4 this way:
<img jwcid="@Image" 
image="ognl:page.getComponent('allAssets').getAsset('document')"/>

Hope this helps.

Marcel


-----Original Message-----
From: Steven Schermerhorn [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 07, 2005 8:45 PM
To: Tapestry users
Subject: Combined context-asset tags

Is there a way to put all of the context-assets in one file, and then be able 
to get the assets from anh page or component?

--
-- Steven Schermerhorn
--

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

Reply via email to