Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic selection in Combobox  RSS feed

 
hal arres
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10948
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
hal arres
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!