Instead of two String[]s build a form-bean with a collection of LabelValueBeans 
(http://jakarta.apache.org/struts/api/org/apache/struts/util/LabelValueBean.html).  

You can find sample implementations in html-select.jsp which is in the 
struts-exercise-taglib application that ships with Struts.

Sri

-----Original Message-----
From: Jain, Shilpi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 25, 2003 11:34 PM
To: Struts Users Mailing List
Subject: How to get the label[] and the value[] both from a select box?


I am using a multiple select box in my application. I have a problem with that one. 

For my multiple select box I have 2 separate String[] one representing the labels of 
the options and another for value. The problems that I am facing are following:

1. The html:options tag has property and labelProperty tags associated with this 
multiple select list box but when the form is submitted the corresponding String[] are 
not updated for the new values in the UI(These values were changed on the UI using 
java script). 

 

2. The property of string[] associated with the html:select tag was getting updated 
but only for the selected value so I explicitly selected all values in the list box 
before submitting the jsp. But this itself had another problem. The values coming in 
the select property String[] were that of the labels in the list box not values!

In my form beans I have setters for both the array and the arrayelement with the same 
name but of-course with different arguments

Can anyone help me. This is really really urgent.

 

Thanks

Shilpi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to