You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Prem Kumar Ponnuraj <pr...@wipro.com> on 2001/12/28 16:54:47 UTC

How do I use nested Collections with iterate tag?

Hi,

I have an ArrayList of ArrayList.
/***
ArrayList objScreenDetailsContainer = new ArrayList();
ArrayList objRowDetails = new ArrayList();
objRowDetails.add("Hello1");
objRowDetails.add("Hello2");
objScreenDetailsContainer.add(objRowDetails);
objRowDetails = new ArrayList();
objRowDetails.add("World1");
objRowDetails.add("World2");
objScreenDetailsContainer.add(objRowDetails);
***/

I have set the objScreenDetailsContainer object to the form bean.

Could you give an idea of how to get this collection from the form bean
to the iterate tag(I'm not setting that object in the request).

Also my display requirement is this :
/***
<table>
<tr>
<td><input type="radio" name="D1" value="<the index of the
ArrayList>"></td>
<td>Hello1</td>
<td>Hello2</td>
</tr>
<tr>
<td><input type="radio" name="D1" value="<the index of the
ArrayList>"></td>
<td>World1</td>
<td>World2</td>
</tr>
</table>
***/

The problems faced are :
Not able to get the object from the bean (applcation scope)thru' iterate
tag.
Not able to get the indexId of the ArrayList and set it as value to the
radio.
Don't have idea of how to get the inner ArrayList and iterate.

the code for this will be of much help.We want to achieve this with tags
alone.We
don't want to use scriptlets.

Rgds,

Prem


Re: How do I use nested Collections with iterate tag?

Posted by Ted Husted <hu...@apache.org>.
You might have a look at Arron's Nested Struts Extension

http://www.keyboardmonkey.com/struts/index.html


Prem Kumar Ponnuraj wrote:
> 
> Hi,
> 
> I have an ArrayList of ArrayList.
> /***
> ArrayList objScreenDetailsContainer = new ArrayList();
> ArrayList objRowDetails = new ArrayList();
> objRowDetails.add("Hello1");
> objRowDetails.add("Hello2");
> objScreenDetailsContainer.add(objRowDetails);
> objRowDetails = new ArrayList();
> objRowDetails.add("World1");
> objRowDetails.add("World2");
> objScreenDetailsContainer.add(objRowDetails);
> ***/
> 
> I have set the objScreenDetailsContainer object to the form bean.
> 
> Could you give an idea of how to get this collection from the form bean
> to the iterate tag(I'm not setting that object in the request).
> 
> Also my display requirement is this :
> /***
> <table>
> <tr>
> <td><input type="radio" name="D1" value="<the index of the
> ArrayList>"></td>
> <td>Hello1</td>
> <td>Hello2</td>
> </tr>
> <tr>
> <td><input type="radio" name="D1" value="<the index of the
> ArrayList>"></td>
> <td>World1</td>
> <td>World2</td>
> </tr>
> </table>
> ***/
> 
> The problems faced are :
> Not able to get the object from the bean (applcation scope)thru' iterate
> tag.
> Not able to get the indexId of the ArrayList and set it as value to the
> radio.
> Don't have idea of how to get the inner ArrayList and iterate.
> 
> the code for this will be of much help.We want to achieve this with tags
> alone.We
> don't want to use scriptlets.
> 
> Rgds,
> 
> Prem
> 
>   ------------------------------------------------------------------------
>                            Name: Wipro_Disclaimer.txt
>    Wipro_Disclaimer.txt    Type: Plain Text (text/plain)
>                        Encoding: 7bit
> 
>   ------------------------------------------------------------------------
> --
> 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>