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

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

Introduction

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

Prototype

public final Component setOutputMarkupId(final boolean output) 

Source Link

Document

Sets whether or not component will output id attribute into the markup.

Usage

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

License:Apache License

/**
 * //  w w w  .j  a va2 s  .  co 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;
}