File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Dynamic selection in Combobox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamic selection in Combobox" Watch "Dynamic selection in Combobox" New topic
Author

Dynamic selection in Combobox

hal arres
Ranch Hand

Joined: Jan 10, 2003
Posts: 30
Hi,

I try to handle a dynamic selection in a combobox, but I got a problem.

To add the combobox to a jsp page and fill it, I use the following code


This combobox is on different pages and I want to show the previous selected item on each page, but I don't know how.
I tryed the following code, but it doesn't work:


Can anyone tell me, what I am doing wrong?
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4710
    
    7

I would use the htmlptionsCollection tag instead. It encapsulates all the logic you've written using logic:iterate to display the options and the logic to select the option that matches the current value of the "selected" property.




Originally posted by hal arres:
Hi,

I try to handle a dynamic selection in a combobox, but I got a problem.

To add the combobox to a jsp page and fill it, I use the following code




Junilu - [How to Ask Questions] [How to Answer Questions]
hal arres
Ranch Hand

Joined: Jan 10, 2003
Posts: 30
Hi,

this is the first time, I heard of optionsCollection, but it is the better way to use ComboBoxes.

Thank you Junilu Lacar

mfg
arres
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic selection in Combobox