This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes retaining selected values.....list box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "retaining selected values.....list box" Watch "retaining selected values.....list box" New topic
Author

retaining selected values.....list box

Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
Dear All

I am using the following code in my JSP page
<html:select property="items" size="4" multiple="true">
<html ptions name="TestForm" property="items" labelProperty="items"/>
</html:select>

I am using form and DTO getItems() and setItems(). Thransfering the data from the DAo to DTO and assigning to form in the action class using BeanUtils.copyProperies() method.

In the initial page load, all the items are displayed, highlightinh all values selected. That's fine. Based on the selected items, I am doing a search and the results are displayed in a seperate tab in the same page.

problem:

when the user goes back to the selection page, the previous selected items are to to be retainined.

How can I do this??

Thanks in advance.


Srini
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
I found the solution from this website:
http://www.coderanch.com/t/46409/Struts/html-options-horrible-default-settings

Thanks to 'Junilu Lacar' for clearing my funda.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: retaining selected values.....list box
 
Similar Threads
retrieve drop down value
/html:select multiple="true"/ problem while editing page
How to use multiple attribute on html:select struts tag
Html:select – can selected value hold object instead of string?
how i get selected list data