Class SelectFormElement

java.lang.Object
com.foreach.across.modules.web.ui.elements.ContainerViewElement
com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
com.foreach.across.modules.bootstrapui.elements.FormControlElementSupport
com.foreach.across.modules.bootstrapui.elements.SelectFormElement
All Implemented Interfaces:
FormControlElement, FormInputElement, com.foreach.across.modules.web.ui.elements.HtmlViewElement, com.foreach.across.modules.web.ui.MutableViewElement, com.foreach.across.modules.web.ui.ViewElement

public class SelectFormElement extends FormControlElementSupport
Represents a HTML select element. Supports both a default HTML select, and the more advanced bootstrap-select. The latter is activated by setting a SelectFormElementConfiguration using setConfiguration(SelectFormElementConfiguration).
Author:
Arne Vandamme
See Also:
  • Field Details

  • Constructor Details

    • SelectFormElement

      public SelectFormElement()
  • Method Details

    • getConfiguration

      public SelectFormElementConfiguration getConfiguration()
      Get the attached bootstrap-select configuration if there is any.
      Returns:
      configuration or null in case of a simple HTML select
    • setConfiguration

      public SelectFormElement setConfiguration(SelectFormElementConfiguration configuration)
      Set a bootstrap-select configuration. If a non-null value is provided, the select will be converted into a bootstrap-select if the client-side resources have been registered.
      Parameters:
      configuration - to use
    • setDisabled

      public SelectFormElement setDisabled(boolean disabled)
      Specified by:
      setDisabled in interface FormInputElement
      Overrides:
      setDisabled in class FormControlElementSupport
      Returns:
      this.
    • setReadonly

      public SelectFormElement setReadonly(boolean readonly)
      Specified by:
      setReadonly in interface FormControlElement
      Overrides:
      setReadonly in class FormControlElementSupport
      Returns:
      this.
    • setRequired

      public SelectFormElement setRequired(boolean required)
      Specified by:
      setRequired in interface FormControlElement
      Overrides:
      setRequired in class FormControlElementSupport
      Returns:
      this.
    • setName

      public SelectFormElement setName(String name)
      Specified by:
      setName in interface com.foreach.across.modules.web.ui.MutableViewElement
      Overrides:
      setName in class FormControlElementSupport
    • setControlName

      public SelectFormElement setControlName(String controlName)
      Specified by:
      setControlName in interface FormInputElement
      Overrides:
      setControlName in class FormControlElementSupport
    • setHtmlId

      public SelectFormElement setHtmlId(String htmlId)
      Specified by:
      setHtmlId in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      setHtmlId in class FormControlElementSupport
    • addCssClass

      public SelectFormElement addCssClass(String... cssClass)
      Specified by:
      addCssClass in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      addCssClass in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • removeCssClass

      public SelectFormElement removeCssClass(String... cssClass)
      Specified by:
      removeCssClass in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      removeCssClass in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • setAttributes

      public SelectFormElement setAttributes(Map<String,Object> attributes)
      Specified by:
      setAttributes in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      setAttributes in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • setAttribute

      public SelectFormElement setAttribute(String attributeName, Object attributeValue)
      Specified by:
      setAttribute in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      setAttribute in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • addAttributes

      public SelectFormElement addAttributes(Map<String,Object> attributes)
      Specified by:
      addAttributes in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      addAttributes in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • removeAttribute

      public SelectFormElement removeAttribute(String attributeName)
      Specified by:
      removeAttribute in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      removeAttribute in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • setCustomTemplate

      public SelectFormElement setCustomTemplate(String customTemplate)
      Specified by:
      setCustomTemplate in interface com.foreach.across.modules.web.ui.MutableViewElement
      Overrides:
      setCustomTemplate in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • setElementType

      protected SelectFormElement setElementType(String elementType)
      Overrides:
      setElementType in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • addChild

      public SelectFormElement addChild(com.foreach.across.modules.web.ui.ViewElement element)
      Overrides:
      addChild in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • addChildren

      public SelectFormElement addChildren(Collection<? extends com.foreach.across.modules.web.ui.ViewElement> elements)
      Overrides:
      addChildren in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • addFirstChild

      public SelectFormElement addFirstChild(com.foreach.across.modules.web.ui.ViewElement element)
      Overrides:
      addFirstChild in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • clearChildren

      public SelectFormElement clearChildren()
      Overrides:
      clearChildren in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • apply

      public SelectFormElement apply(Consumer<com.foreach.across.modules.web.ui.elements.ContainerViewElement> consumer)
      Overrides:
      apply in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • applyUnsafe

      public <U extends com.foreach.across.modules.web.ui.ViewElement> SelectFormElement applyUnsafe(Consumer<U> consumer)
      Overrides:
      applyUnsafe in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • setTagName

      protected SelectFormElement setTagName(String tagName)
      Overrides:
      setTagName in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • set

      public SelectFormElement set(com.foreach.across.modules.web.ui.ViewElement.WitherSetter... setters)
      Specified by:
      set in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Specified by:
      set in interface com.foreach.across.modules.web.ui.MutableViewElement
      Specified by:
      set in interface com.foreach.across.modules.web.ui.ViewElement
      Overrides:
      set in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • remove

      public SelectFormElement remove(com.foreach.across.modules.web.ui.ViewElement.WitherRemover... functions)
      Specified by:
      remove in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Specified by:
      remove in interface com.foreach.across.modules.web.ui.MutableViewElement
      Specified by:
      remove in interface com.foreach.across.modules.web.ui.ViewElement
      Overrides:
      remove in class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
    • isMultiple

      public boolean isMultiple()
    • setMultiple

      public SelectFormElement setMultiple(boolean multiple)
      Returns:
      this.