• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

collect multiple values using logic:iterate

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
collect multiple values using logic:iterate

I have list of Objects. Each object has list of another Objects
eg:
class S{
private String sname;
private String sdesc;
private List tlist;//list of T classes
..all get/set methods for the above here....
}
class T{
private int tname;
private String tdesc;
..all get/set methods for the above here....
}

I have the following code in JSP:

<bean efine name="TForm" property="SList" id="SList"/>
<logic:iterate name="SList" id="soc" indexId="index">
<tr>
<td>
<bean:write name="soc" property="sDesc"/>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">
<bean efine name="soc" property="tlist" id="tlistforSoc"/>
<html:select property="seltname">
<html ptions collection="tipsListforSoc" property="tname" labelProperty="tdesca" />
</html:select>
</td>
</tr>
</logic:iterate>


A particular 'soc' has list of T's. User can select one T from the list of Ts. So I want to collect all the
Ts for all the Socs. What should the value of 'seltname' in the Form? Should that be an arraylist or array?
I have the following, but it is not working. I am not seeing the whole logic:iterate block on the screen.

Form:

private int[] seltname;

....all get/set methods here....

But I change this array to single value like the following, it works, but it collects only one value:

private String seltname;

I need to collect all the selected Ts for all Socs. Please help.
reply
    Bookmark Topic Watch Topic
  • New Topic