I sort of got it to work, but now when I move items from one side of the
palette to the other and try to save it, the changes are not picked up by
the model and are not saved ...

public class MyPalette extends Palette {
private List<T> unselectedChoices;
public MyPalette(String id, IModel<List&lt;T>> model,
                        IModel<List&lt;T>> choicesModel, IChoiceRenderer<T> 
choiceRenderer,
                        int rows, boolean allowOrder) {
                super(id, model, choicesModel, choiceRenderer, rows, 
allowOrder);
                
                setOutputMarkupId(true);
                unselectedChoices = new ArrayList<T>();
        

        }

@Override
        public void onEvent(IEvent<?> event) {

                super.onEvent(event);

                if (event.getPayload() instanceof MyAutoCompleteUpdate) {

                        MyAutoCompleteUpdate update = (MyAutoCompleteUpdate) 
event
                                        .getPayload();

                        Collection collection = this.getChoices(); // the whole 
set of data,
availalble (unselected) and associated (selected)
                         System.out.println("SIZE " + collection.size() + " ");
                                                
                        
                        unselectedChoices.add((T) update.getModelObject());
                        System.out.println("SIZE UNSELECTED" + 
unselectedChoices.size() + " ");
                        
                        collection.addAll(unselectedChoices);
                        System.out.println("SIZE AFTER ADDING selection" + 
collection.size() + "
");
                        
                

                        update.getTarget().add(this);

                }

        }

}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/unselected-choices-of-Palette-contain-duplicates-tp4656430p4656566.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to