Chetan,

Hmmm.. Usually when you want to use a combo box, you provide both the value and 
the label for each item. Struts has a class called LabelValueBean; use this to 
assign the value to each label. Then pass in the array/list of LabelValueBean 
into <html:options> or <html:optionsCollections>.

Struts cannot magically determine what values you want. So in this instance it 
is using the label as the value (and vice-versa) because that's all you 
specified. To get the index, do what I described above -- values cannot be 
guessed at; you have to supply them.

Paul

Chetan Pandey <[EMAIL PROTECTED]> wrote: Hi List:

I am using a JComboBox in the following manner:


:


 


 


Where holidexCodeVector is a Vector of Strings ( e.g. "BLUES", "IHG",
"SINGTEL" etc )

I only want the index of the chosen item, not the String.

For examples if User chose "IHG" I should get integer 1 , not the String
"IHG"

How is this possible as the underlying data structure is a "int" not String.

Thanks.

Chetan




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



                        
---------------------------------
See the all-new, redesigned Yahoo.com.  Check it out.

Reply via email to