aspose file tools*
The moose likes Struts and the fly likes Help for html:option tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help for html:option tag" Watch "Help for html:option tag" New topic
Author

Help for html:option tag

mitesh mehta
Greenhorn

Joined: Aug 29, 2002
Posts: 25
Hi
i am absolutely new to the Struts framework...
what i want is a basic application showing the values in the Combo from database.
I have made the following code for the jsp page:-
<html:select property="status">
<html ption collection = "categoryList" /> </html:select>
Now i am also coding the setter and getter method for property "status" which returns the String in the form class.
what changes i have to make in the action class to make it return the collection.
Any help will be appreciated in advance.
Thanking you
Mitesh
Lakshmanan NS
Greenhorn

Joined: Apr 02, 2003
Posts: 20
Hi, Here is a sample.
<html:select property="teamParentId" >
<html ptions name="idList" labelName="labelList"/>
</html:select>
Here, teamParentId is a form variable. the Form has a getter and setter for this.
idList and labelList are collection that is put into pageContext. You can bring the collection into JSP through request scope / sessions scope. In JSP you can set them in pageContext
Hope this help
Lakshman
mitesh mehta
Greenhorn

Joined: Aug 29, 2002
Posts: 25
Hi Lakshman,
Thanks for the reply.I am still having a small doubt.
Now
<html:select property="teamParentId" >
will have the corresponding getter/setter methods.
But i wanted to know where should i set the idList and labelList for the request scope?
Suppose i have a combo to display the months can you please suggest me how shld i prepare the option tag for the same?
Thanks for the help
Mitesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help for html:option tag