Class FieldBase

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, Ordered, ScriptEventSupport, Field, LifecycleElement, org.springframework.core.Ordered
Direct Known Subclasses:
ActionField, DataFieldBase, FieldGroup, GenericField, ImageField, LinkField, MessageField, ProgressBarField, SpaceField

public class FieldBase extends ComponentBase implements Field
Base class for Field implementations

Sets the component type name so that all field templates have a fixed contract

Holds a nested Label with configuration for rendering the label and configuration on label placement.

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

    • FieldBase

      public FieldBase()
  • Method Details

    • performApplyModel

      public void performApplyModel(Object model, LifecycleElement parent)
      The following finalization is performed:
      • Make sure that a label is defined for any data fields. If not then create hidden label using property name.
      • If no label for a non data field then just log a warning.
      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
    • afterEvaluateExpression

      public void afterEvaluateExpression()
      No-op implementation. Override for custom behavior in subclasses. Invoked by the view lifecycle after expressions are evaluated at the apply model phase.

      In general, this method is preferred to LifecycleElement.performApplyModel(Object, LifecycleElement) for populating model data via code, since it is called before client-side state is synchronize.

      Specified by:
      afterEvaluateExpression in interface Component
      Overrides:
      afterEvaluateExpression in class ComponentBase
    • performFinalize

      public void performFinalize(Object model, LifecycleElement parent)
      The following finalization is performed:
      • Set the labelForComponentId to this component id
      • 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
      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
    • setNestedComponentIdAndSuffix

      protected void setNestedComponentIdAndSuffix(Component component, String suffix)
      Helper method for suffixing the ids of the fields nested components
      Parameters:
      component - component to adjust id for
      suffix - suffix to append to id
    • getComponentTypeName

      public final String getComponentTypeName()
      The name for the component type

      This is used within the rendering layer to pass the component instance into the template. The component instance is exported under the name given by this method.

      Specified by:
      getComponentTypeName in interface Component
      Returns:
      String type name
    • getLabel

      public String getLabel()
      Description copied from interface: Field
      Label text for the field

      The label is generally used to identify the field in the user interface

      Specified by:
      getLabel in interface Field
      Returns:
      String label text
      See Also:
    • setLabel

      public void setLabel(String labelText)
      Description copied from interface: Field
      Setter for the field's label text
      Specified by:
      setLabel in interface Field
      See Also:
    • getLabelStyleClasses

      public List<String> getLabelStyleClasses()
      Description copied from interface: Field
      Label style classes for the field
      Specified by:
      getLabelStyleClasses in interface Field
      Returns:
      List<String> label style classes
      See Also:
    • setLabelStyleClasses

      public void setLabelStyleClasses(List<String> labelStyleClasses)
      Description copied from interface: Field
      Setter for the field's label style classes
      Specified by:
      setLabelStyleClasses in interface Field
      See Also:
    • getLabelColSpan

      public int getLabelColSpan()
      Description copied from interface: Field
      Label column span for the field
      Specified by:
      getLabelColSpan in interface Field
      Returns:
      int label column span
      See Also:
    • setLabelColSpan

      public void setLabelColSpan(int labelColSpan)
      Description copied from interface: Field
      Setter for the field's label column span
      Specified by:
      setLabelColSpan in interface Field
      See Also:
    • getShortLabel

      public String getShortLabel()
      Description copied from interface: Field
      Short label for the field

      For areas of the user interface that have limited area (such as table headers), the short label can be used to identify the field

      Specified by:
      getShortLabel in interface Field
      Returns:
      String short label
      See Also:
    • setShortLabel

      public void setShortLabel(String shortLabel)
      Description copied from interface: Field
      Setter for the field's short label text
      Specified by:
      setShortLabel in interface Field
      Parameters:
      shortLabel -
      See Also:
    • setShowLabel

      public void setShowLabel(boolean showLabel)
      Sets whether the label should be displayed

      Convenience method for configuration that sets the hidden indicator on the fields Label instance. The label is not really hidden but set off screen for accessibility.

      Parameters:
      showLabel - true if label should be hidden, false if the label should not be hidden
    • getFieldLabel

      public Label getFieldLabel()
      Description copied from interface: Field
      Label instance for the field

      The label field contains the labeling text for the field in addition to configuration for rendering in the user interface (such as the styling for the label area)

      Specified by:
      getFieldLabel in interface Field
      Returns:
      Label instance
      See Also:
    • setFieldLabel

      public void setFieldLabel(Label fieldLabel)
      Description copied from interface: Field
      Setter for the field's label field
      Specified by:
      setFieldLabel in interface Field
      See Also:
    • isLabelLeft

      public boolean isLabelLeft()
      The label for this field will be positioned to the left of the field content, when true.

      The usage of this option is for one-off instances in which a label must be positioned to the left of a field for layout purposes. It is recommended that if many fields will have their labels positioned to the left in a group that a CssGridLabelColumnLayoutManager backed group be used instead.

      Specified by:
      isLabelLeft in interface Field
    • setLabelLeft

      public void setLabelLeft(boolean labelLeft)
      Specified by:
      setLabelLeft in interface Field
      See Also:
    • isLabelRendered

      public boolean isLabelRendered()
      Description copied from interface: Field
      Indicates whether the contained Label has been rendered as part of another field and thus should not be rendered with the attribute
      Specified by:
      isLabelRendered in interface Field
      Returns:
      boolean true if the label field has been rendered, false if it should be rendered with the attribute
      See Also:
    • setLabelRendered

      public void setLabelRendered(boolean labelRendered)
      Description copied from interface: Field
      Setter for the label field rendered indicator
      Specified by:
      setLabelRendered in interface Field
      See Also:
    • getFieldSecurity

      public FieldSecurity getFieldSecurity()
      Description copied from interface: Field
      Field Security object that indicates what authorization (permissions) exist for the field
      Specified by:
      getFieldSecurity in interface Field
      Returns:
      FieldSecurity instance
      See Also:
    • setComponentSecurity

      public void setComponentSecurity(ComponentSecurity componentSecurity)
      Override to assert a FieldSecurity instance is set
      Specified by:
      setComponentSecurity in interface Component
      Overrides:
      setComponentSecurity in class ComponentBase
      Parameters:
      componentSecurity - instance of FieldSecurity
    • initializeComponentSecurity

      protected void initializeComponentSecurity()
      Initializes (if necessary) the component security instance for the component type
      Overrides:
      initializeComponentSecurity in class ComponentBase
    • isEditInLineAuthz

      public Boolean isEditInLineAuthz()
      See Also:
    • setEditInLineAuthz

      public void setEditInLineAuthz(Boolean editInLineAuthz)
      See Also:
    • isViewInLineAuthz

      public Boolean isViewInLineAuthz()
      See Also:
    • setViewInLineAuthz

      public void setViewInLineAuthz(Boolean viewInLineAuthz)
      See Also: