Example usage for org.apache.wicket.markup.html.basic EnumLabel setOutputMarkupId

List of usage examples for org.apache.wicket.markup.html.basic EnumLabel setOutputMarkupId

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.basic EnumLabel 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:de.alpharogroup.wicket.components.factory.ComponentFactory.java

License:Apache License

/**
 * Factory method for create a new {@link EnumLabel}.
 *
 * @param <T>/*from   w w  w  .j  a v a 2 s.c o m*/
 *            the generic type of the model
 * @param id
 *            the id
 * @param model
 *            the model of the label
 * @return the new {@link EnumLabel}.
 */
public static <T extends Enum<T>> EnumLabel<T> newEnumLabel(final String id, final IModel<T> model) {
    final EnumLabel<T> enumLabel = new EnumLabel<T>(id, model) {
        /** The serialVersionUID. */
        private static final long serialVersionUID = 1L;

        /**
         * {@inheritDoc}
         */
        @Override
        protected String resourceKey(final T value) {
            return value.name();
        }
    };
    enumLabel.setOutputMarkupId(true);
    return enumLabel;
}