All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IQueueRegion, IHeaderContributor, IComponentResolver, IRequestableComponent, IHierarchical<Component>, IClusterable

public class FormGroup extends Border
Simple form control group that is able to show a label, help text and feedback message additional to wrapped form element.
Author:
miha
See Also:
  • Constructor Details

    • FormGroup

      public FormGroup(String id)
      Construct.
      Parameters:
      id - the wicket component id
    • FormGroup

      public FormGroup(String id, IModel<String> label)
      Construct.
      Parameters:
      id - the wicket component id
      label - the label
    • FormGroup

      public FormGroup(String id, IModel<String> label, IModel<String> help)
      Construct.
      Parameters:
      id - the wicket component id
  • Method Details

    • useFormComponentLabel

      public FormGroup useFormComponentLabel(boolean value)
      Parameters:
      value - whether to use form components label as control group label or not
      Returns:
      this instance for chaining
    • size

      @Deprecated public FormGroup size(FormGroup.Size size)
      Deprecated.
      Not supported by Bootstrap 4. Use InputBehavior.size(InputBehavior.Size) on the FormComponent instead.
      sets the size of form-group
      Parameters:
      size - the size to use
      Returns:
      this instance for chaining
    • newFeedbackMessageToCssClassNameTransformer

      protected Function<FeedbackMessage,String> newFeedbackMessageToCssClassNameTransformer()
      Returns:
      new function that transforms a FeedbackMessage to a css class name
    • newLabel

      protected Component newLabel(String id, IModel<String> model)
      creates a new label
      Parameters:
      id - the component id
      model - the content model for this component
      Returns:
      new label
    • newFeedbackMessageContainer

      protected Component newFeedbackMessageContainer(String id)
      creates a new container for a feedback message
      Parameters:
      id - the component id
      Returns:
      new feedback message container
    • newHelpLabel

      protected Component newHelpLabel(String id, IModel<String> model)
      creates a new help label that contains a help message for the form field. This field will be set to invisible if there is no content.
      Parameters:
      id - the component id
      model - the content model for this component
      Returns:
      new help label
    • onComponentTag

      protected void onComponentTag(ComponentTag tag)
      Overrides:
      onComponentTag in class Component
    • onInitialize

      protected void onInitialize()
      Overrides:
      onInitialize in class MarkupContainer
    • addOutputMarkupId

      protected void addOutputMarkupId(List<FormComponent<?>> formComponents)
      sets the output markup id flag to true for all given formComponents. This is necessary to reference them in a "for" attribute on client side.
      Parameters:
      formComponents - the form components to add the output markup id
    • onConfigure

      protected void onConfigure()
      Overrides:
      onConfigure in class Border