How can I filter the available list in a palette?  I have a dropdown to
specify the filter and I can retrieve the filtered list from my data
access.  How do I set the available list in the palette to be my new
filtered list?

 

Here is my code for creating the palette and also the filter button that
is going to do the filtering.  I can get the definedChoices.  The
problem I am having is what needs to go between the comments.

 

Thanks for any help.

 

List<Items> definedChoices = dao.findItems();

                IChoiceRenderer renderer = new
ItemChoiceRenderer("name", "value");

                final Palette palette = new Palette("values", new
Model((Serializable)definedChoices), renderer, 10, true);

                palette.setMarkupId("values");

                palette.setOutputMarkupId(true);

                 palette.setOutputMarkupPlaceholderTag(true);

                 add(palette);

 

                AjaxButton filterButton = new AjaxButton("filter") {

                                @Override

                                protected void
onSubmit(AjaxRequestTarget target, Form<?> form) {

                                                String product =
productDropDown.getValue();

                                                String type =
typeDropDown.getValue();

                                                                

                                                List<Item>
definedChoices = dao.findItemsByFilter(product, type);

                                                 //
**********************************

                                                // HOW DO I SET THE
AVAILABLE LIST FOR THE PALETTE???           

                                                //
***********************************

 
target.addComponent(palette);

                                }

                };

                filterButton.setDefaultFormProcessing(false);

                add(filterButton);

Reply via email to