All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<Boolean,FormComponent<Boolean>>, IMetadataContext<Serializable,Component>, IQueueRegion, IFormModelUpdateListener, IFormVisitorParticipant, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class BootstrapToggle extends de.agilecoders.wicket.core.markup.html.bootstrap.form.BootstrapCheckbox
An extension of CheckBox that transforms a normal HTML checkbox to two styled buttons (Yes+No)

Integrates Bootstrap Toggle

See Also:
  • Constructor Details

    • BootstrapToggle

      public BootstrapToggle(String id)
      Constructor. Should be used when this component has a parent with CompoundPropertyModel
      Parameters:
      id - The component id
    • BootstrapToggle

      public BootstrapToggle(String id, IModel<Boolean> model)
      Constructor.
      Parameters:
      id - The component id
      model - The model to keep the selection
    • BootstrapToggle

      public BootstrapToggle(String id, BootstrapToggleConfig config)
      Constructor.
      Parameters:
      id - The component id
      config - The configuration of this Bootstrap widget
    • BootstrapToggle

      public BootstrapToggle(String id, IModel<Boolean> model, BootstrapToggleConfig config)
      Constructor.
      Parameters:
      id - The component id
      model - The model to keep the selection
      config - The configuration of this Bootstrap widget
  • Method Details

    • newCheckBox

      protected CheckBox newCheckBox(String id, IModel<Boolean> model)
      Overrides:
      newCheckBox in class de.agilecoders.wicket.core.markup.html.bootstrap.form.BootstrapCheckbox
    • onConfigure

      protected void onConfigure()
      Overrides:
      onConfigure in class Component
    • getConfig

      public BootstrapToggleConfig getConfig()
      Returns:
      The configuration for the widget.
    • getOffLabel

      protected IModel<String> getOffLabel()
    • getOnLabel

      protected IModel<String> getOnLabel()