wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts pre selecting multi select" Watch "Struts pre selecting multi select" New topic
Author

Struts pre selecting multi select

Nisha Kala
Greenhorn

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:if><br/>
</s:iterator><br/>

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

How can i do multi select.


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts pre selecting multi select
 
Similar Threads
Struts2 test condition in s:if not working
Struts 2 - conditional check of IteratorStatus inside an s:if tag
How to iterate through List of objects using OGNL <s:iterator> tag in struts2
struts2 struts-tags iteration question
Struts 2 iterator