« Return to Thread: Curious issue with dropdown control?

Curious issue with dropdown control?

by Ted Byers :: Rate this Message:

Reply to Author | View in Thread

In the output from Apache Tomcat 6.0.16, I see the following:

"com.sun.webui.jsf.component.DropDown::The current value of component form1:dropDown2 does not match any of the selections.
"Did you forget to reset the value after changing the options? "

Why would this happen?  I NEVER change the options.  I programmatically set the selected value in only one place, as follows:

        com.sun.webui.jsf.model.Option[] tpOptions = (com.sun.webui.jsf.model.Option[])getDropDown2().getItems();
        getDropDown2().setSelected(tpOptions[0]);

This happens in the change event handler for the other dropdown control.  The idea is that dropdown2 should default to the first option it holds whenever a new item is selected using dropdown1.

Or is it the case that getItems+setSelected doesn't work the way I would intuitively expect?

Thanks

Ted

 « Return to Thread: Curious issue with dropdown control?