struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <shirishchandra.sakh...@ubs.com>
Subject RE: Best Practices in <html:select>
Date Tue, 06 Apr 2004 13:11:43 GMT
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:Ram.S.Kumar@acs-inc.com]
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: shirishchandra.sakhare@ubs.com [mailto:shirishchandra.sakhare@ubs.com]

Sent: Tuesday, April 06, 2004 6:00 PM
To: user@struts.apache.org
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:Ram.S.Kumar@acs-inc.com]
Sent: Tuesday, April 06, 2004 2:26 PM
To: user@struts.apache.org
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message