On 3/1/06, Ryan Wynn <[EMAIL PROTECTED]> wrote:
> I am getting the following exception and though I have looked at bug
> 37796 I still can't decide if what I am trying to do cannot be done
> with symbol replacement or if I have made a mistake.
>
> The Component jsfid attribute is null. The cause is most likely a
> missing "clayJsfid" attribute when using HTML templates and nesting
> a clay component. It is also likely that the problem was caused by using
> generic templates with symbol replacement of the
> [EMAIL PROTECTED]:
> java.lang.NullPointerException
>
> In my component that extends clay, clayJsfid is tied to a value
> binding expression [EMAIL PROTECTED] and in my .html file I
> specify the symbol managed-bean-name to be myBean.
>
> What exactly constitutes a generic template?
>
> Thanks,
> Ryan
>
Here is some more information about my problem.
I have the following files
add.html
<span jsfid="clay" clayJsfid="templates/template.html"
content="views/add.html"/>
templates/template.html
<TABLE width="100%" border="1">
<TBODY>
<TR>
<TD colspan="2" height="20" valign="top"
bgcolor="lightblue">Scheduler
Application</TD>
</TR>
<TR>
<TD width="20%" height="600" valign="top">
<A href="#" jsfid="addContactLink">Add New
Contact</A><BR>
<BR>
<A href="#" jsfid="viewContactsLink">View
Contacts</A><BR>
<BR>
<A href="#" jsfid="newTaskLink">Add New Task</A><BR>
<BR>
<A href="#" jsfid="viewTasksLink">View Tasks</A><BR>
<BR>
</TD>
<TD width="80%" height="600" valign="top"><SPAN
jsfid="clay"
clayJsfid="@content" allowBody="false"><b>Hello
World!</b></SPAN></TD>
</TR>
</TBODY>
</TABLE>
views/add.html
<span jsfid="collage:wizard" wizardBean="addPersonWizard" />
Now, views/add.html is where the problem is. collage:wizard is
specified as follows
<component jsfid="collage:wizard" extends="panelGrid"
allowBody="false">
<attributes>
<set name="columns" value="1" />
<set name="cellspacing" value="0" />
<set name="cellpadding" value="0" />
<set name="border" value="0" />
</attributes>
<element renderId="1" jsfid="clay">
<attributes>
<set name="clayJsfid" value="[EMAIL PROTECTED]" />
</attributes>
</element>
<element renderId="2" jsfid="panelGrid">
<attributes>
<set name="columns" value="4" />
<set name="cellspacing" value="0" />
<set name="cellpadding" value="10" />
<set name="border" value="0" />
</attributes>
<element renderId="1" jsfid="collage:commandButton">
<attributes>
<set name="value" value="Back" />
<set name="action" value="[EMAIL PROTECTED]" />
<set name="rendered"
value="[EMAIL PROTECTED]" />
</attributes>
</element>
<element renderId="2" jsfid="collage:commandButton">
<attributes>
<set name="value" value="Next" />
<set name="action" value="[EMAIL PROTECTED]" />
<set name="rendered"
value="[EMAIL PROTECTED]" />
</attributes>
</element>
<element renderId="3" jsfid="collage:commandButton">
<attributes>
<set name="value" value="Back" />
<set name="action" value="[EMAIL PROTECTED]" />
<set name="rendered"
value="[EMAIL PROTECTED]" />
</attributes>
</element>
<element renderId="4" jsfid="collage:commandButton">
<attributes>
<set name="value" value="Back" />
<set name="action" value="[EMAIL PROTECTED]" />
<set name="rendered"
value="[EMAIL PROTECTED]" />
</attributes>
</element>
</element>
</component>
wizardBean has an attribute called viewId which corresponds to the
current view of the wizard (e.g. /views/page1.html). This viewId will
change with calls to wizardBean.next, wizardBean.back, etc.
It seems like Clay is not able to resolve the symbol wizardBean in
collage:wizard in order to dynamically display the nested clay
component. Again this is the message that I get:
The Component jsfid attribute is null. The cause is most likely a
missing "clayJsfid" attribute when using HTML templates and nesting
a clay component. It is also likely that the problem was caused by using
generic templates with symbol replacement of the
[EMAIL PROTECTED]:
java.lang.NullPointerException
I am going to run it through the debugger. Please let me know if you
have any advice.
Thanks,
Ryan