0

Listbox selection from java code does not work

asked 2009-07-28 17:17:50 +0800

gyowanny gravatar image gyowanny
283 1 2 6

Hi

I'm trying to execute the following code to restore the list's selection:

beanList.addItemToSelection(beanList.getItemAtIndex(this.selectedBeanListIndex));

This is not working for me. I would like to know at least if is it possible to set the listbox selection from the java source code?

Thank you

Gyo

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-07-28 17:43:09 +0800

gyowanny gravatar image gyowanny
283 1 2 6

I found the solution. I have to send an event to the listbox after setting up the selected index:

public void onCancel(Event evt){
   Listbox beanList = (Listbox)this.getFellow("beanList");
   beanList.setSelectedIndex(this.selectedBeanListIndex);
   Events.sendEvent(beanList, new Event(Events.ON_SELECT, evt.getTarget()));
}

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: 2009-07-28 17:17:50 +0800

Seen: 180 times

Last updated: Jul 28 '09

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