You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by SUPRIYA MISRA <su...@hotmail.com> on 2002/02/08 20:15:35 UTC

Question on Nesting iterate tags

How do you nest two iterate tags


<slogic:iterate id="actHour"  name="currentForm"   type= "fal.ActivityHour"  
property="actHourArray">  .
               <slogic:iterate id="actHour1"  name="currentForm" >
               type="fal.LocationHrs"   property="actHour.selected">
               </slogic:iterate>
</slogic:iterate>

Both Collections are Arrays.
Array 1 contains a bunch of Strings and and Array 2. Array 2 contains a 
bunch of Strings. I will have to use text boxes to update for which i plan 
to use the indexed tags.

Any Help would be appreciated. Any links alsp would be helpful

Thanks

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Question on Nesting iterate tags

Posted by Arron Bates <ar...@pacific.net.au>.
This appears to be kind of confusing. What you have marked up will loop 
through the second array for each iteration of the first array.

Is this what you're after?...

It's kind of hard to see what it is that you're trying to achieve. Is 
the second array meant to be relative the the first or not?...

Either way, to nest iterators I recommend the nested extension.
http://www.keyboardmonkey.com/struts

To learn about it, go there, to download it also unless you're on a 
nightly build after the middle of January.


Arron.



Aamir Saalam wrote:

>I am *not* sure if i am addressing this question in specific.
>
>Here's an example of Nested logic:iterate tag's:
>
>
><%
>  String[] array1 = {"A1", "A2", "A3"};
>  String[] array2 = {"B1", "B2", "B3"};
>  pageContext.setAttribute("Array1", array1, PageContext.PAGE_SCOPE);
>  pageContext.setAttribute("Array2", array2, PageContext.PAGE_SCOPE);
>%>
>
><logic:iterate id="array1Ele" name="Array1">
>  <logic:iterate id="array2Ele" name="Array2">
>    <bean:write name="array1Ele"/> 
>    <bean:write name="array2Ele"/> 
>  </logic:iterate>
></logic:iterate>
>
>
>--aamir
>
>-----Original Message-----
>From: SUPRIYA MISRA [mailto:supriya_misra@hotmail.com]
>Sent: Friday, February 08, 2002 11:16 AM
>To: struts-user@jakarta.apache.org
>Subject: Question on Nesting iterate tags
>
>
>How do you nest two iterate tags
>
>
><slogic:iterate id="actHour"  name="currentForm"   type= "fal.ActivityHour"  
>property="actHourArray">  .
>               <slogic:iterate id="actHour1"  name="currentForm" >
>               type="fal.LocationHrs"   property="actHour.selected">
>               </slogic:iterate>
></slogic:iterate>
>
>Both Collections are Arrays.
>Array 1 contains a bunch of Strings and and Array 2. Array 2 contains a 
>bunch of Strings. I will have to use text boxes to update for which i plan 
>to use the indexed tags.
>
>Any Help would be appreciated. Any links alsp would be helpful
>
>Thanks
>
>_________________________________________________________________
>Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Question on Nesting iterate tags

Posted by Aamir Saalam <as...@cisco.com>.
I am *not* sure if i am addressing this question in specific.

Here's an example of Nested logic:iterate tag's:


<%
  String[] array1 = {"A1", "A2", "A3"};
  String[] array2 = {"B1", "B2", "B3"};
  pageContext.setAttribute("Array1", array1, PageContext.PAGE_SCOPE);
  pageContext.setAttribute("Array2", array2, PageContext.PAGE_SCOPE);
%>

<logic:iterate id="array1Ele" name="Array1">
  <logic:iterate id="array2Ele" name="Array2">
    <bean:write name="array1Ele"/> 
    <bean:write name="array2Ele"/> 
  </logic:iterate>
</logic:iterate>


--aamir

-----Original Message-----
From: SUPRIYA MISRA [mailto:supriya_misra@hotmail.com]
Sent: Friday, February 08, 2002 11:16 AM
To: struts-user@jakarta.apache.org
Subject: Question on Nesting iterate tags


How do you nest two iterate tags


<slogic:iterate id="actHour"  name="currentForm"   type= "fal.ActivityHour"  
property="actHourArray">  .
               <slogic:iterate id="actHour1"  name="currentForm" >
               type="fal.LocationHrs"   property="actHour.selected">
               </slogic:iterate>
</slogic:iterate>

Both Collections are Arrays.
Array 1 contains a bunch of Strings and and Array 2. Array 2 contains a 
bunch of Strings. I will have to use text boxes to update for which i plan 
to use the indexed tags.

Any Help would be appreciated. Any links alsp would be helpful

Thanks

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>