Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do this? Please help

Status
Not open for further replies.

yacanna

Programmer
Oct 24, 2003
15
US
In my index.jsp page(The portal page of my site), I like to have a drop down list box listing all the product categories so that the use can choose one category and search.

So in my javabean, let us call DataManagerBean, I have function public Collection getProductCategories(), which retrieving the categories from database table.

Now in my index.jsp page; I have something like
------------------------------------------
<html:form action="/SeachProducts.do">
<html:select property="prodCategory" size="1" >
<html:eek:ption value="0"> Select Category</html:eek:ption>
<html:eek:ptions> ??? ( I like to list all the products categories by calling getProductCategories()???
</html:select>
<html:submit value="Submit"/>
</html:form>
----------------------------------------------

I am confused because this is index page, I don't have any formbean associated with this. How can I accomplish this??? Any help would be great apprecated!!!
 
Why can't you have a FormBean associated to your index.jsp? That way the Form would have the logic to populate your options list with ValueObjects that would give you the id and the text to display.

Einstein47
(For best results: hand wash in cold, tumble dry low. For not so good results: drag through puddles, pound on rocks, air dry on tree branch.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top