> I'm trying to use the Image component to show an image 
on my Home page. 
> Here's what I think I have to do:

You typically define your assets as part of the 
component specification.  Tapestry tries to limit Java 
coding to interesting things.

> 
> Home.html
>    <span jwcid="myImage"/>

I tend to write this as <img jwcid="myImage"/> just to 
be clear on what I expect it to do.  Tapestry doesn't 
care ... you could say <lemon-jello jwcid="myImage"/> if 
your wanted.


> 
> Home.jwc
>    <component id="myImage" type="Image">
>      <binding name="image" property-path="homeImage"/>
>   < /component>

Change the path to "assets.homeImage".  Every component 
exports a property, assets, that is a map of all assets 
defined for the component (in the next section).


  <private-asset name="homeImage" 
path="/package/home.gif"/>

(Please check the attributes ... from memory I may make 
a mistake).

That's it ... no Java code.

Sidenote:  there are one or two places in Tapestry where 
things don't work if the code is generated in 
the "default package".  Always use a real package to 
avoid problems.



> 
> Home.java
>    public IAsset getHomeImage()
>    {
>       return getAsset( "home.gif" ) ;
>    }
> 
> Deployment 'classes' directory:
>   home.gif
> 
> This isn't working and I'm pretty sure it's because I 
don't have a good grip 
> on how to use assets.  This is a private asset I'm 
trying to use.  Any help 
> would be greatly appreciated.  I'm really enjoying 
learning Tapestry, but I 
> want to go faster!
> 
> Thanks from a new Tapestry fan :),
> Rowland


--
[EMAIL PROTECTED]

http://tapestry.sf.net

_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to