0

How to clear a listbox selection

asked 2011-04-13 11:53:49 +0800

bztom33 gravatar image bztom33
104 3

I can't reset the listbox selection to empty after the a button was clicked.

 public void onSelect$myListBox(Event e) {
     alert("selected: " + myListBox.getSelectedItem().getValue());
  }
...
 public void onClick$testButton(Event e) {
       //trying to clear out the selection in myListBox

	myListBox.clearSelection();
  
  }

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2011-04-13 12:32:52 +0800

twiegand gravatar image twiegand
1807 3

bztom33,

You might give the following a try:

myListBox.setSelectedIndex(-1);

Regards,

Todd

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-04-13 11:53:49 +0800

Seen: 1,000 times

Last updated: Apr 13 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More