Hi
In order for this to work, you need the following:
<component jsfid="baseHomeLayout" extends="clay" id="baseHomeLayout">
<attributes>
<set name="clayJsfid" value="/templates/main_template.html"
/>
</attributes>
<symbols>
<set name="title"
value="#{webLabels['msg.public.headTitle']}" />
</symbols>
</component>
<component jsfid="/user_calendar.jsf" extends="baseHomeLayout">
<symbols>
<set name="content" value="/templates/column_template.html">
<set name="left_column" value="/components/empty.html" />
<set name="right_column" value="/components/empty.html" />
</symbols>
</component>
Then in /templates/column_template.html you must have the symbols
@left_column and @right_column defined and in /templates/main_template.html
you must have @content defined
Take a look at the tutorials here:
[1] http://wiki.apache.org/shale/ShaleAndClayTutorial
[2] http://wiki.apache.org/shale/CreatingClayComponents
Hermod
-----Opprinnelig melding-----
Fra: JS Portal Support [mailto:[EMAIL PROTECTED]
Sendt: 10. april 2007 13:23
Til: [email protected]
Emne: Clay nested templates
Hi,
I'm experimenting with Clay and I like it. A few things are not quite clear
to me though. I can make my page /user_calendar.jsf work with the following
clay config:
<component jsfid="baseHomeLayout" extends="clay" id="baseHomeLayout">
<attributes>
<set name="clayJsfid" value="/templates/main_template.html" />
</attributes>
<symbols>
<set name="title" value="#{webLabels['msg.public.headTitle']}" />
<set name="content" value="/components/empty.html" />
</symbols>
</component>
<component jsfid="/user_calendar.jsf" extends=" baseHomeLayout ">
<symbols>
<set name="content" value="/components/empty.html" />
</symbols>
</component>
But I wish to insert another template inside a template, and thought the
following might work:
<component jsfid="/user_calendar.jsf" extends="baseHomeLayout">
<set name="content" value="/templates/column_template.html">
<symbols>
<set name="left_column" value="/components/empty.html" />
<set name="right_column" value="/components/empty.html" />
</symbols>
</set>
</symbols>
</component>
but it doesn't. I get the parse error:
java.lang.NoSuchMethodException: No such accessible method: addSymbol() on
object: org.apache.shale.clay.config.beans.SymbolBean.
I guess I will need to create an Element for the inserted template, but
tried different approaches but can't seem to get it to work. I could
obviously create a second complete template hardcoding
/templates/column_template.html in /templates/main_template.html, but that
defeats the Clay purpose.
Thank you,
joost