list box

we have a list box with some values...

the selected value is inserted into the database

later,after retrieving the same String from result set ,we want it to be set as "selected" in the list box...( for modification purpose)

how will we do it?

[268 byte] By [relnaa] at [2007-11-27 11:30:03]
# 1

Hi,

you are asking in jsp <list> , or java List or jsf ..,

drvijayy2k2a at 2007-7-29 16:31:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

jsp <list>

relnaa at 2007-7-29 16:31:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

hi,

simply you go like this,

<select name="id" size="5">

<option value=<%="rs.getString(n)%>" selected> </option>

</select>

Now your data will shown in list with selected

drvijayy2k2a at 2007-7-29 16:31:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

ok vijay...

then what about other static elements in that list box ...

i want all the elements in that list box to be displayed along with the selected item

relnaa at 2007-7-29 16:31:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...