You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jeffrey Schneller <je...@envisa.com> on 2009/12/09 23:07:51 UTC

Palette adding choices

I have a palette defined with a set of available choices.  I can move
those choices to the right into the selected choices.  On my page I have
a modal popup that can be launched to add a custom choice.  The choice
is added to the available choices in the palette but the selected
choices are reset.  How do I keep the selected choices set and add the
new choice to remaining available choices.  I have done a Google search
but don't have the correct keywords to find anything useful.  The key
pieces of code are below.  Thanks.

 

Private List definedOptions = new ArrayList();

 

// code found in constructor of page

final Palette palette = new Palette("options", new
Model((Serializable)definedOptions), renderer, 10, true);

palette.setMarkupId("palette");

palette.setOutputMarkupId(true);

palette.setOutputMarkupPlaceholderTag(true);

add(palette);

 

// code found in the onclick of the AjaxLink on the page

definedOptions.add(opt);

target.addComponent(palette);