what about this:

   <foreach expression="contents" key="content">
       var pane = dojo.widget.createWidget("ContentPane",
{id:"${content.id}"+"AccordionContainer", label:"${content.label}"});
       pane.setContent("${content.content}");
   </foreach>

That works fine in my script file.


On 5/30/06, Eric Schneider <[EMAIL PROTECTED]> wrote:
Shing,

Thanks for the thread.

> Alternatively, you could contruct your 'Loop part' in
> a java class and pass it to the script.

The content is html intensive, I'd prefer not to construct it in Java,
but it's definitely a fall back plan.

Thanks again.
Eric

On 5/30/06, Shing Hing Man <[EMAIL PROTECTED]> wrote:
> There are some posts on <Foreach> in the archive. Here
> is one of them :
> 
http://article.gmane.org/gmane.comp.java.tapestry.user/31759/match=foreach+script
>
> Alternatively, you could contruct your 'Loop part' in
> a java class and pass it to the script.
>
> Shing
>
> --- Eric Schneider <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > I trying to track down an example of a Script
> > component that iterates
> > over a list.   The ${expression} syntax seems easy
> > enough, but I'm
> > unclear how create the equivalent of a foreach in
> > Script component
> > land.
> >
> > The desired result is something like this:
> >
> > <script type="text/javascript">
> >
> >       var scrollingContentElement=new Array();
> >
> >       <start foreach list, anObject, index>
> >               scrollingContentElement[${index}] =
> > '${anObject.frameContent}';
> >       <end foreach>
> >
> > </script>
> >
> > Can someone point me in the right direction?
> >
> > Thanks in advance.
> > Eric
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
>
>
> Home page :
>   http://uk.geocities.com/matmsh/index.html
>
>
>
> ___________________________________________________________
> Now you can scan emails quickly with a reading pane. Get the new Yahoo! Mail. 
http://uk.docs.yahoo.com/nowyoucan.html
>
> ---------------------------------------------------------------------
> 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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to