Ok, I'll post the code:
The Home.html:
<html>
<head><title>Tapestry Study</title></head>
<body jwcid="$content$">
<span jwcid="@Border"> </span>
</body>
</html>
The Home.page:
<page-specification>
</page-specification>
The Border Component:
<html>
<head></head>
<body jwcid="@Body">
<span jwcid="[EMAIL PROTECTED]:JSCookMenu" source="ognl:menuModel"
value="ognl:menuItem" ">
<a_ href="#" jwcid="[EMAIL PROTECTED]"
listener="listener:onNavigate" parameters="ognl:menuItem.value" >
<span jwcid="@Insert" value="ognl:menuItem.value"/>
</a_>
</span>
</body>
</html>
The Border.JWC file:
<component-specification>
<asset name="xmlModel"
path="classpath:/com/partner/tapestry/start-menu.xml" />
<component id="menu" type="menu:JSCookMenu">
</component>
</component-specification>
The Border.JAVA file (section of interest):
public abstract class Border extends BasePage implements
PageBeginRenderListener{
private ArrayList<IJSCookMenuItem> model = null;
public Iterable<IJSCookMenuItem> getMenuModel(){
return model;
}
public abstract IJSCookMenuItem getMenuItem();
public void pageBeginRender(PageEvent arg0) {
......
The Border.PAGE file:
<page-specification>
<asset path="context:/images/startmenu/book.gif" name="book"/>
/// some more assets....
</page-specification>
Now the errors:
FIRST Exception:
Unable to read OGNL expression '<parsed OGNL expression>' of
[EMAIL PROTECTED]/$Border]: $BaseComponent_1.menuModel
And it show the line <span jwcid="[EMAIL PROTECTED]:JSCookMenu"
source="ognl:menuModel" value="ognl:menuItem" theme="Office2003"
position="hbr""> on the BORDER.HTML
The second exception is the same, but it shows the line:
<span jwcid="@Border"> </span>
on the Home.HTML file.
The third is the stack trace.
Thanks for the help! :-)
Denis Souza-3 wrote:
>
> It might help if you post some code and the actual exception (you only
> posted the stack trace).
>
> -----Original Message-----
> From: Thx1011 [mailto:[EMAIL PROTECTED]
> Sent: quinta-feira, 14 de dezembro de 2006 11:00
> To: [email protected]
> Subject: Re: Moving Components inside a Border Component...
>
>
> Hi!
>
> Thanks for your help, but I think that this is not quite the problem that
> I
> have...
>
> Let's suppose one component named XPTO, that takes one parameter PARM.
>
> So in my "normal" Home page I use it like this:
>
> <span jwcid="@XPTO" PARM="ognl:xmlAsset'">
>
> This is ok, I think.
>
> Now I move that line to inside the HTML new component named Border.
>
> So my Home page becomes:
>
> <span jwcid="@Border">
>
> And Inside the new Border HTML, I put the same line above:
>
> <span jwcid="@XPTO" PARM="ognl:xmlAsset">
>
> What happens now is that I get an exception saying that can't parse the
> OGNL
> Expression....
>
> I've moved the property accessors to the Border.java, but still it doesn't
> work.
>
> The exception is:
>
> # ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:123)
> # ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1616)
> # ognl.ASTProperty.getValueBody(ASTProperty.java:96)
> # ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
> # ognl.SimpleNode.getValue(SimpleNode.java:210)
> # ognl.Ognl.getValue(Ognl.java:333)
> # ognl.Ognl.getValue(Ognl.java:310)
>
> So what I'm missing?
>
> I really can't figure it out...
>
>
>
>
> Ron Piterman-2 wrote:
>>
>> you put it in the template of the component, and thats it.
>> if you want it to be configured from the page/container you use
>> parameter chain.
>>
>> for example:
>>
>> your border might contain (and probably will):
>>
>> <html jwcid="@Shell" title="ognl:title">...
>>
>> since the title is different in every page you add
>> a title parameter to your border:
>>
>> @Parameter(required=true) public abstract String getTitle();
>>
>> and when using the border:
>>
>> <html jwcid="@Border" title="...">
>>
>> the title will be "passed through" to the shell.
>>
>> Quite easy :)
>>
>> Cheers,
>> Ron
>>
>>
>> This High Xvision wrote:
>>> Hi! (I'm a newbie, so please bear with me...)
>>>
>>> I'm trying to build a Border Component.
>>>
>>> So far so good, it works as long as I don't embed
>>> another component.
>>>
>>> For example if on my Home.Html page I add
>>>
>>> <span jwcid="@Border">
>>> <span jwcid="@menu:jsCookMenu ....>
>>>
>>> It works.
>>>
>>> But I want to move the jscookmenu inside the Border
>>> component, and oh
>>> boy, I am beginning to give up and go to JSF... :-)
>>>
>>> So my question is very simple:
>>>
>>> How to instantiate a component inside of a component?
>>>
>>> I've tried everything that I remember of and read the
>>> forums, but no
>>> solution...
>>>
>>> Inside the .JWC file on the <Component-specification>,
>>> I've put the
>>> jscookmenu asset, but I need to instanciate the
>>> jscookmenu, right?
>>>
>>> How?
>>>
>>> Thanks!
>>>
>>>
>>>
>>>
> ____________________________________________________________________________
> ________
>>> Do you Yahoo!?
>>> Everyone is raving about the all-new Yahoo! Mail beta.
>>> http://new.mail.yahoo.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Moving-Components-inside-a-Border-Component...-tf28199
> 68.html#a7871990
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Moving-Components-inside-a-Border-Component...-tf2819968.html#a7873807
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]