This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes how to use list box in struts and how to retrive values in edit page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to use list box in struts and how to retrive values in edit page " Watch "how to use list box in struts and how to retrive values in edit page " New topic
Author

how to use list box in struts and how to retrive values in edit page

giribabu rosi
Greenhorn

Joined: Apr 14, 2005
Posts: 17
please tell me how to use list box and

how to use List box in edit page??
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'm assuming that by "list box", you mean a combination of the <select> and <option> html tags.

Struts has custom tags for dealing with this type of control. Read the information in the following link, focusing specifically on the <html:select> and <html ptions> tags.

http://struts.apache.org/api/org/apache/struts/taglib/html/package-summary.html#package_description


Merrill
Consultant, Sima Solutions
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
I am thinking you are asking for select box implementation in struts.

For select box with dynamic values you need to create 3 variables

1. to hold the selected value
2. arraylist of option values
3. arraylist of option names

For select box with static values you need to create 1 variable

1. to hold the selected value

<html:select name="formBean" property="selectPropertyName">
<html ption value="value">display name</html ption>
</html:select>

And populate the select box in your display action bean.

I hope this helps you.
giribabu rosi
Greenhorn

Joined: Apr 14, 2005
Posts: 17
no am using

<html:select multiple="true" property="badGuy">

an inserting values in create page

how do i show the inserted value in editpage.
[ May 09, 2005: Message edited by: giribabu rosi ]
 
jQuery in Action, 2nd edition
 
subject: how to use list box in struts and how to retrive values in edit page