File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts pre selecting multi select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts pre selecting multi select" Watch "Struts pre selecting multi select" New topic

Struts pre selecting multi select

Nisha Kala

Joined: Nov 17, 2010
Posts: 21
Hi <br/>
I am using struts with java.<br/>
I have a string List that contains<br/>
List<String> nameList = new ArrayList<String>();<br/>
nameList = name1, temp, avg1, avg2

my select box(avg) contains values avg1, avg2, avg3, avg4.

Using iterator i had separated the values as<br/>
<s:iterator value="nameList" status="sta1" var="totlis"> <br/>
<s:if test="#sta1.count == 1"><br/>
<s:set var="name" value="%{nameList.get(#sta1.index)}"/><br/>
<s:set var="desc" value="%{nameList.get(#sta1.index+1)}"/><br/>
<s:set var="avgval" value="%{nameList.get(#sta1.index+2)}"/><br/>

<s:select value="%{#avgval}" list="#populate.avg" multiple="true" size="3" />

How can i do multi select.

wood burning stoves
subject: Struts pre selecting multi select