Example usage for org.apache.wicket.extensions.markup.html.form.select SelectOptions setRecreateChoices

List of usage examples for org.apache.wicket.extensions.markup.html.form.select SelectOptions setRecreateChoices

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.markup.html.form.select SelectOptions setRecreateChoices.

Prototype

public SelectOptions<T> setRecreateChoices(final boolean refresh) 

Source Link

Document

Controls whether SelectOption s are recreated on each render.

Usage

From source file:eu.uqasar.web.dashboard.widget.datadeviation.DataDeviationSettingsPanel.java

License:Apache License

/**
 * // ww  w .  j  ava  2 s. c  o  m
 * @param wicketId
 * @param selections
 * @return
 */
private SelectOptions<String> newSelectOptions(String wicketId, final List<String> selections) {

    //   IModel<List<String>> model = new Model<List<String>>();

    SelectOptions<String> selectOptions = new SelectOptions<>(wicketId, Model.ofList(selections),
            new IOptionRenderer<String>() {
                private static final long serialVersionUID = 1L;

                @Override
                public String getDisplayValue(String object) {
                    return object;
                }

                @Override
                public IModel<String> getModel(String value) {
                    return new Model<>(value);
                }
            });
    selectOptions.setRecreateChoices(true);
    selectOptions.setOutputMarkupId(true);

    return selectOptions;
}