0

ZK Listbox Selectitems issue with Set

asked 2014-04-15 10:49:15 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

For details question you can check this link http://stackoverflow.com/questions/23076867/java-set-not-adding-object-when-selecting-items-from-listbox

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

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

Darksu gravatar image Darksu
1991 1 4

updated 2014-08-19 14:06:56 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

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_Item">Link

Best Regards,

Darksu

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2014-04-15 10:49:15 +0800

Seen: 21 times

Last updated: Aug 19 '14

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