Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
giribabu rosi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please tell me how to use list box and

how to use List box in edit page??
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Srilakshmi Vara
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic