Revision history [back]

click to hide/show revision 1
initial version

answered 2014-06-13 05:53:20 +0800

cor3000 gravatar image cor3000

ZK Team

If you are using a listbox with a model (doesn't matter if MVC or MVVM) you need to control the selection via the model.

As shown in this example on zkfiddle.

So simply call model.clearSelection() and model.addToSelection(newValue);

If you retrieve the model from the listbox, you'd have to cast to org.zkoss.zul.ext.Selectable<E> in order to get access to the clearSelection and addToSelection methods.

Of course this implies that you model implements the Selectable interface which is the case anyway for all AbtractListModel implementations.

Robert

If you are using a listbox with a model (doesn't matter if MVC or MVVM) you need to control the selection via the model.

As shown in this example on zkfiddle.

So simply call model.clearSelection() model.clearSelection() and model.addToSelection(newValue);

If you retrieve the model from the listbox, you'd have to cast to org.zkoss.zul.ext.Selectable<E> in order to get access to the clearSelection and addToSelection methods.

Of course this implies that you model implements the Selectable interface which is the case anyway for all AbtractListModel implementations.

Robert

If you are using a listbox with a model (doesn't matter if MVC or MVVM) you need to control the selection via the model.

As shown in this example on zkfiddle.

So simply call model.clearSelection() and model.addToSelection(newValue);

If you retrieve the model from the listbox, you'd have to cast to org.zkoss.zul.ext.Selectable<E> in order to get access to the clearSelection and addToSelection methods.

Of course this implies that you your model implements the Selectable interface which is the case anyway for all AbtractListModel implementations.

Robert

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