Why not create the id so that id itself is a concatnated string(id::description).This 
will mean that you will get both Id and description of selected item.
the only thing you have to do is Parse the id::description string to seperate the Id 
and Description.This will mean u dont need even javascript :-))

See the sample code.

MyFromBean{

setId(String id){
 this.id = id;
}
getId(){//get this.id.stringTill::
}

getDescription(){//get this.id.stringAfter::
}
}

HTH.
regards,
Shirish

-----Original Message-----
From: Kumar, Ram S [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 2:55 PM
To: Struts Users Mailing List
Subject: RE: Best Practices in <html:select>


Hi,
I am using LabelValuebean only. The problem is I am looking for an efficient
way to store both the value and the label in the form bean. Usually the
selected id will be stored in the setter method by the frame work. 

I can have one more setter/getter methods for storing the selected text. I
can get the selected text using JavaScript and assign it to the hidden
variable. 

Are there any work around for this?

Thanks in advance.

S.Ramkumar




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Tuesday, April 06, 2004 6:00 PM
To: [EMAIL PROTECTED]
Subject: RE: Best Practices in <html:select>

Struts has a concept of CodeValuebean..(Dont remember the exact class
name.)You should use that.

-----Original Message-----
From: Kumar, Ram S [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 2:26 PM
To: [EMAIL PROTECTED]
Subject: Best Practices in <html:select>
Importance: High


Hi All, 
 In my JSP , I have five <html:select> . what is the best practice to store
the selected id and description in form beans?. Any idea on this?
 
Thanks and Regards,
S.Ramkumar
 

---------------------------------------------------------------------
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]


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

Reply via email to