Better not use the $template asset - it's completely undocumented
and could go away without notice.

Go with the wiki suggestion - you can easily invent variations on it, i.e.
we like keeping the templates (for both pages and components) in the same folder as the .java files - a ClasspathSpecResolverDelegate and a ClasspathComponentSpecResolver
are enough to do the trick.

fyi, TAPESTRY-894 has been fixed

Jim Roycroft wrote:
Nevermind, get$template() was absolutely correct! Man that's ugly....



Jim Roycroft wrote:
Was there something else to this? Any changes to the pages that use the
component? I cannot get this to work.

I presume you meant "getTemplate()" as opposed to "get$template()".



Khan, Hatim wrote:
Ok, it turns out that I can do the following to change the location of a
custom component template:

@ComponentClass(allowBody = true, allowInformalParameters = false)
public abstract class Border extends BaseComponent {
  @Asset("context:/WEB-INF/component/my-border.html")
  public abstract IAsset get$template();
}


--------------------------------------------------------------------------------

Sent: Tue 11/28/2006 3:59 PM
To: users@tapestry.apache.org
Subject: Changing the default location of the component template

Hello,
I am trying to use annotations instead of .jwc files.
I have a custom BaseComponent with a template.  However, I want the
template to be located under WEB-INF/component/mycomponent.html.

Going through some of the code, I found out that you can specify the
location of the template using an asset named '$template'.  This is
great, but how can I use it with annotation?

The only solution that I can think of is introducing a new annotation
say '@AssetTemplate("context:/WEB-INF/component/mycomponent.html")' .
This annotation will simply insert an asset named '$template' with the
given value.

I have seen other solutions using the ISpecificationResolverDelegate,
(http://wiki.apache.org/tapestry/PagesAndComponentsInWEB-INF), but the
Wiki is saying that there is a bug
(http://issues.apache.org/jira/browse/TAPESTRY-894) that will prevent
the delegate solution from working correctly?

Any advice will be greatly appreciated.

Thanks




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




--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting

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

Reply via email to