struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amir Iqbal" <aiq...@netlife.com.sg>
Subject Re: Using select tag
Date Tue, 03 Oct 2000 02:52:53 GMT


Hi,
Its very simple
You can use something like this

<struts:select property="selectedState" size="1" style="font-family: Verdana,
Arial; font-size: 8pt">
     <struts:options property="stateCodes" labelProperty="stateNames"/>
</struts:select>

This tag is inside the body of a <struts:from> tag. This tag uses the ActionForm
 bean for getting list of states and state codes.
Your ActionForm bean should have two properties of type Collection (array,
Vector, Lists etc) with names stateCodes, and stateNames.
These properties are used in Options tag to get values and lables for select
tag.
A third property selectedState will be used to track the user selection.
I hope this will help. If you need further information let me know

Regards
Amir








"Gaurav Gehlot" <ggehlot@arzoo.com> on 09/29/2000 06:50:01 AM

Please respond to struts-user@jakarta.apache.org
                                                                                
                                                                                
                                                                                


                                                              
                                                              
                                                              
 To:      "Struts-User" <struts-user@jakarta.apache.org>      
                                                              
 cc:      (bcc: Amir Iqbal/Singapore/Netlife)                 
                                                              
                                                              
                                                              
 Subject: Using select tag                                    
                                                              








Hi,
   I want to use the select tag in struts to print out the list of US states
along with their codes.Something like this,

     <select name="states">
     <option value="AZ">Arizona</option>
     <option value="CA">California</option>
     ...
     </select>

     The list of states and their codes is a two dimensional array of strings in
a bean.
     How can i do it in struts framework?

TIA,
gg


Mime
View raw message