struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sriram <sri...@nunet-tech.com>
Subject RE: drop-down list help
Date Tue, 22 Jul 2003 13:11:05 GMT
Swaroop,

Even I am looking for code for drop-down lists. 

Are you using LabelValueBean in DropDownCollections.java?
Is there any alternative to LabelValueBean - I tried using Struts 1.1 but I'm facing lot of
problems while deploying. And I am in a hurry to get this task completed. So, I am looking
for developing code for drop-downs using struts 1.0 (that means I can't use LabelValueBean).

Sriram

-----Original Message-----
From: Swaroop George [mailto:sgeorge@sapient.com] 
Sent: Tuesday, July 22, 2003 6:36 PM
To: Struts Users Mailing List
Subject: RE: drop-down list help


<jsp:useBean id="dropdown" scope="application" class="com.xxx.DropdownCollections">
   </jsp:useBean>


<bean:define id="months" name="dropdown" property="months" toScope="request"/>

<html:select property="month> 
 <html:options collection="months" property="key" labelProperty="value"/>
 </html:select>   


Hi this is a part of the page I developed.. (Ofcourse a commercial
application..) I have a class called DropDownCollections.java Now in the class I have a method
getMonths() which will return me a collection of months..

I am using the months collection to populate the options..
You can actually use an html:select instead of a nested:select

The getMonths() returns a set of beans having two attributes key and value.. Key will be the
month numbers 1,2,3,4.. While value will be month names Jan, Feb,.. While the dropdown is
rendered the month name will be shown.. When the page is submitted the month num(key) will
be set to the property 'month'

Hope it helps..
Swaroop

-----Original Message-----
From: Rick Col [mailto:rick_cols@yahoo.com] 
Sent: Tuesday, July 22, 2003 6:24 PM
To: Struts Users Mailing List
Subject: drop-down list help

Hi, guys:

I am a struts newbie. I have spent sevaral days trying
build a struts page with several drop-down lists in
vain. I am wondering there are any struts drop down
lists examples out there. I appreciate your help. 

regards,


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com

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


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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message