Drop down list setSelected not working

Hi all,

I have a drop down list bound to a database (value: int, display: string). There are two pages:

page 1: a table with id needed for page 2 (id passed through the url)

page 2: drop down list bounded to a database. The selected value comes from page 1.

Problem: Even though I am getting the correct value, and am using ddList.setSelected (id), the ddList value does not change.

I basically want to know how to program the functionality of the"selected" property in java with a table bound to a database.

Any ideas?

[571 byte] By [nasheiaa] at [2007-11-26 14:19:57]
# 1

Hi There,

Looks like a user on this thread was able to set his drop down list value dynamically, take a look

http://forum.java.sun.com/thread.jspa?forumID=881&threadID=5055898

here is what the user comments

-

Any way I have solved my problem

1.Change the value field of dropdown from int to string, so value field and display fields are same.

2. dropdown1.setvalue("abc");

this solution will only work if the value field is String.

-

Hope it helps

Thanks

K

kish@suna at 2007-7-8 2:11:12 > top of Java-index,Development Tools,Java Tools...
# 2
Hi,Thanks for replying me. What I did: ddABC.setSelected(new Integer(id))The value was not being set because it was expecting an integer not a string since it was bound to an integer value from a table.Thanks alot :-)
nasheiaa at 2007-7-8 2:11:12 > top of Java-index,Development Tools,Java Tools...