reset value after selection

Hi,

I am using 2 drop down list, both are populated from database.

On value change of first drop down list, values of second drop down list are retrieved.

Every thing seems to look ok on screen, however after completion of firstDD_processValueChang method, I see in log following message. Just wondering, whats wrong and how to fix it?

[#|2006-08-29T20:30:03.359+0100|INFO|sun-appserver-pe8.2|javax.enterprise.syste m.stream.out|_ThreadID=16;|

com.sun.rave.web.ui.component.DropDown::The current value of component form1:secondDD does not match any of the selections.

Did you forget to reset the value after changing the options? |#]

[678 byte] By [ndzpac] at [2007-11-26 9:48:23]
# 1
A similar forum thread: http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=101855
KarthikR at 2007-7-7 0:56:07 > top of Java-index,Development Tools,Java Tools...
# 2

The following excerpts are from http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/abo ut_components.html:

For the items property, you specify a display label and a return value for each item in the list. The selected property returns an object, or, if the multiple property is selected, an array of objects, of the same type as the return values.

If the multiple property is false, the value of the component's selected property matches the return value of the selected list item. If the multiple property is set to true (to enable the user to select more than one item), you must bind selected to an array of Object, an array of primitives, or java.util.List. If you use java.util.List, you must specify a converter for the type of the List members unless they are String objects. The array contains values that match the return values of the selected items.

Say, for example, that your Options list is as follows

Display Value: Return Value

Java SE: jse

Java EE: jee

Java ME: jme

If you call dropDownList1.setSelected("jdk") then the current value of component form1:dropDownList1 does not match any of the selections because there is no return value that matches "jdk". With this options list, you can only setSelected() with the values jse, jee, or jme.

Hope this helps,

Chris (aka Jane Jetsons aka diva#2)

jetsons at 2007-7-7 0:56:07 > top of Java-index,Development Tools,Java Tools...