Okay, I'll have to look at it again. I'm running T4-beta-11 so it should
be okay. Right now it looks like the an ognl reference isn't being
updated or something. I don't know. I'll have to pound on it some more
(hopefully before I pull all my hair out).
On Sat, 2005-11-05 at 00:02 +0200, Mind Bridge wrote:
> Hi,
>
> The trick is in the following line:
>
> <comp jwcid="@For" source="ognl:menuItems" value="ognl:menuItem">
>
> Basically, the currently rendered node is placed in the menuItem
> property and the getMenuItems() function must return the children of the
> node currently in menuItem.
>
> Here is some example code:
>
> public List getMenuItems() {
> List items;
> Customer item = getMenuItem();
> // fill 'items' with the children of the 'item' node
> if (item == null)
> items = (List) personMap.get(new Integer(0)); // 0 is the root
> else
> items = (List) personMap.get(new Integer(item.getId()));
> return items;
> }
>
> Also, please make sure you use a recent beta -- I am not sure your code
> would work in an old one.
>
> Dan Adams wrote:
> > Hey, can you explain a little more how the below works? Right now I'm
> > trying to get something similar working but for some reason it's going
> > into an infinite loop in that it keeps asking for the children of the
> > root node rather than actually drilling down.
> >
> > On Fri, 2005-11-04 at 22:09 +0200, Mind Bridge wrote:
> >
> >> Hi,
> >>
> >> > For example common framework components (like Foreach, If, etc.)
> >> cache their parameters.
> >>
> >> Actually, they used to, but they do not anymore and can participate in
> >> recursion. See http://issues.apache.org/jira/browse/TAPESTRY-654?page=all.
> >>
> >> The following works well, for example:
> >>
> >> <comp jwcid="@RenderBlock" block="ognl:components.subMenuItems"/>
> >> <comp jwcid="[EMAIL PROTECTED]">
> >> <comp jwcid="@For" source="ognl:menuItems" value="ognl:menuItem">
> >> <comp jwcid="@Insert" value="ognl:menuItem.fullName"/><br/>
> >> <comp jwcid="@If" condition="ognl:menuItems != null">
> >> <comp jwcid="@Insert" value=" "/>
> >> <comp jwcid="@RenderBlock"
> >> block="ognl:components.subMenuItems"/>
> >> </comp>
> >> </comp>
> >> </comp>
> >>
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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]
>
--
Dan Adams
Software Engineer
Interactive Factory
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]