All Implemented Interfaces:
IBootstrapButton<BootstrapAjaxButton>, Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<String,FormComponent<String>>, IMetadataContext<Serializable,Component>, IFormModelUpdateListener, IFormSubmitter, IFormSubmittingComponent, IFormVisitorParticipant, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable
Direct Known Subclasses:
NavbarAjaxButton

public abstract class BootstrapAjaxButton extends AjaxButton implements IBootstrapButton<BootstrapAjaxButton>
Default AjaxButton which is styled by bootstrap.
Author:
miha
See Also:
  • Constructor Details

    • BootstrapAjaxButton

      public BootstrapAjaxButton(String componentId, Buttons.Type type)
      Construct.
      Parameters:
      componentId - The component id
      type - The type of the button
    • BootstrapAjaxButton

      public BootstrapAjaxButton(String componentId, IModel<String> model, Buttons.Type type)
      Construct.
      Parameters:
      componentId - The component id
      model - The label
      type - The type of button
    • BootstrapAjaxButton

      public BootstrapAjaxButton(String id, Form<?> form, Buttons.Type type)
      Construct.
      Parameters:
      id - The component id
      form - The assigned form
      type - The type of button
    • BootstrapAjaxButton

      public BootstrapAjaxButton(String id, IModel<String> model, Form<?> form, Buttons.Type type)
      Construct.
      Parameters:
      id - The component id
      model - The label
      form - The assigned form
      type - The type of button
  • Method Details

    • onInitialize

      protected void onInitialize()
      Overrides:
      onInitialize in class AjaxButton
    • newIcon

      protected Icon newIcon(String markupId)
      creates a new icon component
      Parameters:
      markupId - the component id of the icon
      Returns:
      new icon component
    • newLabel

      protected <L extends Serializable> Component newLabel(String markupId, IModel<L> model)
      creates a new label component
      Parameters:
      markupId - the component id of the label
      Returns:
      new label component
    • newSplitter

      protected Component newSplitter(String markupId)
      creates a new splitter component. The splitter is visible only if icon is visible and useSplitter is true.
      Parameters:
      markupId - the component id of the splitter
      Returns:
      new splitter component
    • newMarkupSourcingStrategy

      protected final IMarkupSourcingStrategy newMarkupSourcingStrategy()
      Overrides:
      newMarkupSourcingStrategy in class Component
    • onConfigure

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

      public BootstrapAjaxButton setLabel(IModel<String> label)
      sets the label of the button.
      Overrides:
      setLabel in class FormComponent<String>
      Parameters:
      label - the new button label
      Returns:
      reference to the current instance
    • setIconType

      public BootstrapAjaxButton setIconType(IconType iconType)
      sets the button's icon which will be rendered in front of the label.
      Parameters:
      iconType - the new button icon type
      Returns:
      reference to the current instance
    • setSize

      public BootstrapAjaxButton setSize(Buttons.Size size)
      sets the size of the button
      Specified by:
      setSize in interface IBootstrapButton<BootstrapAjaxButton>
      Parameters:
      size - The button size
      Returns:
      this instance for chaining
    • setType

      public BootstrapAjaxButton setType(Buttons.Type type)
      Sets the type of the button
      Specified by:
      setType in interface IBootstrapButton<BootstrapAjaxButton>
      Parameters:
      type - The type of the button
      Returns:
      this instance for chaining
    • useSplitter

      public BootstrapAjaxButton useSplitter(boolean value)
      Parameters:
      value - whether to use splitter between the icon and the label or not
      Returns:
      this instance for chaining