Revision history [back]

click to hide/show revision 1
initial version

answered 2014-08-02 10:12:11 +0800

Darksu gravatar image Darksu

Hello sjoshi,

First of all you should not have any issues by using a Set, but in general using a list is most commonly used.

Furthermore, you have to update your model and your listbox each time you add an item as shown below:

@GlobalCommand
@NotifyChange({"model", "list"})
public void populateList() {
    model = new ListModelList<>();
    model.addAll(updatedList);
}

Finally if you want to assign one selected item, then the following code is wrong:

private Set  selectedListItem;

rather it should be the model type.

For more information please refer to the following url:

http://books.zkoss.org/wiki/ZKDeveloper'sReference/MVVM/DataBinding/CollectionandSelection#BindingtoSelectedItem

Best Regards,

Darksu

Hello sjoshi,

First of all you should not have any issues by using a Set, but in general using a list is most commonly used.

Furthermore, you have to update your model and your listbox each time you add an item as shown below:

@GlobalCommand
@NotifyChange({"model", "list"})
public void populateList() {
    model = new ListModelList<>();
    model.addAll(updatedList);
}

Finally if you want to assign one selected item, then the following code is wrong:

private Set  selectedListItem;

rather it should be the model type.

For more information please refer to the following url:

http://books.zkoss.org/wiki/ZK_Developer's_Reference/MVVM/Data_Binding/Collection_and_Selection#Binding_to_Selected_Itemhttp://books.zkoss.org/wiki/ZKDeveloper'sReference/MVVM/DataBinding/CollectionandSelection#BindingtoSelectedItem">Link

Best Regards,

Darksu

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