0

ZK ListBox listModel out of sync after sorting getSelection

asked 2013-02-20 16:29:44 +0800

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of
90 1 5

hey guys i am new to ZK framework i have a listbox being sorted in the view later i pass the listBox to the controller and i need the items being selected by the user but in the model the items are syncronized with the sorting but in the getSelection array is not syncronized with the sort insted with the original data here is the code.

public void createPDFFromModel(Listbox list,String ref){                
BindingListModelList model = (BindingListModelList)list.getModel();
for(int i=0;i<model.size();i++){
    System.out.println((((ZamoraListitemAdapter)model.get(i)).getName()));
}  
System.out.println("-------------------------------------------");
//Data Printed OK.
java.util.ArrayList<ZamoraListitemAdapter>selections = new java.util.ArrayList<ZamoraListitemAdapter>(model.getSelection());
for(int i=0;i<selections.size();i++){//Printin getSelection
    ZamoraListitemAdapter clazz = (ZamoraListitemAdapter)selections.get(i);
    System.out.println(clazz.getName());
    //Out of sync with model and with sorting 
}

my question is how i get the order of the items after the sort in getSelection model. i am using ZK 5.2.8

delete flag offensive retag edit
Be the first one to answer this question!
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: 2013-02-20 16:29:44 +0800

Seen: 21 times

Last updated: Feb 20 '13

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