Class Label

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, Ordered, ScriptEventSupport, ContentElement, LifecycleElement, org.springframework.core.Ordered

public class Label extends ContentElementBase
Content element that renders a label

Contains options for adding a colon to the label along with a required message

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • Label

      public Label()
  • Method Details

    • performApplyModel

      public void performApplyModel(Object model, LifecycleElement parent)
      Sets up rich message content for the label, if any exists The following updates are done here:
      • Evaluate the progressive render condition (if set) and combine with the current render status to set the render status
      Called after the initialize phase to perform conditional logic based on the model data

      Where components can perform conditional logic such as dynamically generating new fields or setting field state based on the given data

      Specified by:
      performApplyModel in interface LifecycleElement
      Overrides:
      performApplyModel in class ComponentBase
      Parameters:
      model - - Top level object containing the data (could be the form or a top level business object, dto)
      parent - parent lifecycle element
    • performFinalize

      public void performFinalize(Object model, LifecycleElement parent)
      The following finalization is performed:
      • If label text is blank, set render to false for field
      • Set the requiredIndicator
      • Set the label text on the label field from the field's label property
      • Set the render property on the label's required message field if this field is marked as required
      • If the label is hidden then add CSS class to render off screen for accessibility
      The following finalization is done here:
      • progressiveRender and conditionalRefresh variables are processed if set
      • If any of the style properties were given, sets the style string on the style property
      • Set the skipInTabOrder flag for nested components
      The last phase before the view is rendered

      Here final preparations can be made based on the updated view state.

      Specified by:
      performFinalize in interface LifecycleElement
      Overrides:
      performFinalize in class ComponentBase
      Parameters:
      model - - top level object containing the data
      parent - - parent component
    • getLabelForComponentId

      public String getLabelForComponentId()
      Indicates the id for the component the label applies to

      Used for setting the labelFor attribute of the corresponding HTML element. Note this gets set automatically by the framework during the initialize phase

      Returns:
      component id
    • setLabelForComponentId

      public void setLabelForComponentId(String labelForComponentId)
      Setter for the component id the label applies to
      Parameters:
      labelForComponentId -
    • getLabelText

      public String getLabelText()
      Text that will display as the label
      Returns:
      label text
    • setLabelText

      public void setLabelText(String labelText)
      Setter for the label text
      Parameters:
      labelText -
    • isRenderColon

      public boolean isRenderColon()
      Indicates whether a colon should be rendered after the label text, generally used when the label appears to the left of the field's control or value
      Returns:
      true if a colon should be rendered, false if it should not be
    • setRenderColon

      public void setRenderColon(boolean renderColon)
      Setter for the render colon indicator
      Parameters:
      renderColon -
    • isRenderRequiredIndicator

      public boolean isRenderRequiredIndicator()
      True if the indicator will be displayed when this label is first render, false otherwise.

      This is set by the framework based on required constraint state, and generally should NOT be set in most cases.

      Returns:
      true if rendering, false otherwise
    • setRenderRequiredIndicator

      public void setRenderRequiredIndicator(boolean renderRequiredIndicator)
      Parameters:
      renderRequiredIndicator -
      See Also:
    • getRequiredIndicator

      public String getRequiredIndicator()
      String indicator that will be displayed as a required indicator

      To indicate a field must have a value (required input) the required indicator can be set to display an indicator or text along with the label.

      Returns:
      the required indicator String to display
    • setRequiredIndicator

      public void setRequiredIndicator(String requiredIndicator)
      Parameters:
      requiredIndicator -
      See Also:
    • getRichLabelMessage

      public Message getRichLabelMessage()
      Gets the Message that represents the rich message content of the label if labelText is using rich message tags. DO NOT set this property directly unless you need full control over the message structure.
      Returns:
      rich message structure, null if no rich message structure
    • setRichLabelMessage

      public void setRichLabelMessage(Message richLabelMessage)
      Sets the Message that represents the rich message content of the label if it is using rich message tags. DO NOT set this property directly unless you need full control over the message structure.
      Parameters:
      richLabelMessage -
    • getInlineComponents

      @ViewLifecycleRestriction public List<Component> getInlineComponents()
      Gets the inlineComponents used by index in a Label that has rich message component index tags in its labelText
      Returns:
      the Label's inlineComponents
    • setInlineComponents

      public void setInlineComponents(List<Component> inlineComponents)
      Sets the inlineComponents used by index in a Label that has rich message component index tags in its labelText
      Parameters:
      inlineComponents -
    • completeValidation

      public void completeValidation(ValidationTrace tracer)
      Validates different requirements of component compiling a series of reports detailing information on errors found in the component. Used by the RiceDictionaryValidator.
      Specified by:
      completeValidation in interface Component
      Overrides:
      completeValidation in class ComponentBase
      Parameters:
      tracer - Record of component's location