I have a GWT ListBox with elements:
listBox = new ListBox();
listBox.addItem("A");
listBox.addItem("B");
listBox.addItem("C");
and I would like it not to be selected so that no item is selected. The initial lack of choice should be symbolized by empty text, and after selecting any item, the user cannot select the "selection item".
Unfortunately, the following line:
listBox.setSelectedIndex(-1);
throws IndexOutOfBoundsException.
Is it possible to get this behavior using the GWT ListBox?
source
share