<component id="outer" type="Foreach">
  <binding name="source" expression="..."/>
  <binding name="value" expression="outerValue"/>
</component>

<compnent id="inner" type="Foreach">
  <binding name="source" expression="outerValue"/>
  <binding name="value" expression="innerValue"/>
</component>

This assumes you have properties outerValue and 
innerValue on your page.  You can also directly connect 
the two together:


<component id="outer" type="Foreach">
  <binding name="source" expression="..."/>
</component>

<compnent id="inner" type="Foreach">
  <binding name="source" 
expression="components.outer.value"/>
  <binding name="value" expression="innerValue"/>
</component>

In Tapestry, components are stateful JavaBeans as well.  
The Foreach component exposes a "value" property that is 
the current value it has iterated to (it also exposes 
an "index" property).  The page has a "components" 
property, which is a Map of the components embedded in 
the page.

This is why "objects, methods and properties" is so 
powerful.  Once everything is a stateful object, you can 
easily wire all sorts of things together using 
properties and property paths.



--
[EMAIL PROTECTED]

http://tapestry.sf.net
> 
> Cool!  One more question, is it possible to make the "inner" list
> parameterized with the value from the "outer" list?  If so, what is the
> syntax for this?
> 
> 
> -------------
> From: Howard M. Lewis Ship <[EMAIL PROTECTED]> 
>  Re: Nested Foreach components   
> 2002-10-15 03:25 
> 
> Of course this is supported.  Go wild.
>    ----- Original Message ----- 
>    From: Michael Starr 
>    To: [EMAIL PROTECTED] 
>    Sent: Monday, October 14, 2002 11:41 PM
>    Subject: [Tapestry-developer] Nested Foreach components
>  
>  
>    Newbie question...
>  
>    Is it possible to nest Foreach components?  I have a List of lists that I
> would like to
> display in nested list fashion (unordered list of unordered lists)
>  
>    Thx!
>    -Mike
>  
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to