Class ControlBase

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, Ordered, ScriptEventSupport, Control, ContentElement, LifecycleElement, org.springframework.core.Ordered
Direct Known Subclasses:
CheckboxControl, FileControl, HiddenControl, MultiValueControlBase, PasswordControl, TextAreaControl, TextControlBase

public abstract class ControlBase extends ContentElementBase implements Control
Base class for all Control implementations.
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • ControlBase

      public ControlBase()
  • Method Details

    • performApplyModel

      public void performApplyModel(Object model, LifecycleElement parent)
      Sets the disabledExpression, if any, evaluates it and sets the disabled property
      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 -
    • performFinalize

      public void performFinalize(Object model, LifecycleElement parent)
      Parses the disabled expressions, if any, to equivalent javascript and evaluates the disable/enable when changed property names.
      Specified by:
      performFinalize in interface LifecycleElement
      Overrides:
      performFinalize in class ComponentBase
      Parameters:
      model - top level object containing the data
      parent - parent component
    • 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
      Overrides:
      getComponentTypeName in class ContentElementBase
      Returns:
      String type name
    • getTabIndex

      public int getTabIndex()
      Unique index of the control within the tab order

      Tab index provides a way to set the order users will tab through the controls. The control with index 1 will receive focus when the page is rendered. Tabing from the field will then take the user to the control with index 2, then index 3, and so on.

      Specified by:
      getTabIndex in interface Control
      Returns:
      int the tab index for the control
    • setTabIndex

      public void setTabIndex(int tabIndex)
      Description copied from interface: Control
      Setter for the controls tab order index
      Specified by:
      setTabIndex in interface Control
      Parameters:
      tabIndex -
      See Also:
    • isDisabled

      public boolean isDisabled()
      Description copied from interface: Control
      Indicates whether the control is disabled (doesn't allow input)
      Specified by:
      isDisabled in interface Control
      Returns:
      boolean true if the control is disabled, false if not
      See Also:
    • setDisabled

      public void setDisabled(boolean disabled)
      Description copied from interface: Control
      Setter for the disabled indicator
      Specified by:
      setDisabled in interface Control
      Parameters:
      disabled -
      See Also:
    • getDisabledReason

      public String getDisabledReason()
      Description copied from interface: Control
      If the control is disabled, gives a reason for why which will be displayed as a tooltip on the control
      Specified by:
      getDisabledReason in interface Control
      Returns:
      String disabled reason text
      See Also:
    • setDisabledReason

      public void setDisabledReason(String disabledReason)
      Description copied from interface: Control
      Setter for the disabled reason text
      Specified by:
      setDisabledReason in interface Control
      Parameters:
      disabledReason -
      See Also:
    • isEvaluateDisabledOnKeyUp

      public boolean isEvaluateDisabledOnKeyUp()
      Evaluate the disable condition on controls which disable it on each key up event
      Returns:
      true if evaluate on key up, false otherwise
    • setEvaluateDisabledOnKeyUp

      public void setEvaluateDisabledOnKeyUp(boolean evaluateDisabledOnKeyUp)
      Set evaluateDisableOnKeyUp
      Parameters:
      evaluateDisabledOnKeyUp -
    • getDisabledConditionJs

      public String getDisabledConditionJs()
      Get the disable condition js derived from the springEL, cannot be set.
      Returns:
      the disableConditionJs javascript to be evaluated
    • getDisabledConditionControlNames

      public List<String> getDisabledConditionControlNames()
      Control names to add handlers to for disable functionality, cannot be set
      Returns:
      control names to add handlers to for disable
    • getDisabledWhenChangedPropertyNames

      public List<String> getDisabledWhenChangedPropertyNames()
      Gets the property names of fields that when changed, will disable this component
      Returns:
      the property names to monitor for change to disable this component
    • setDisabledWhenChangedPropertyNames

      public void setDisabledWhenChangedPropertyNames(List<String> disabledWhenChangedPropertyNames)
      Sets the property names of fields that when changed, will disable this component
      Parameters:
      disabledWhenChangedPropertyNames -
    • getEnabledWhenChangedPropertyNames

      public List<String> getEnabledWhenChangedPropertyNames()
      Gets the property names of fields that when changed, will enable this component
      Returns:
      the property names to monitor for change to enable this component
    • setEnabledWhenChangedPropertyNames

      public void setEnabledWhenChangedPropertyNames(List<String> enabledWhenChangedPropertyNames)
      Sets the property names of fields that when changed, will enable this component
      Parameters:
      enabledWhenChangedPropertyNames -
    • setDisabledExpression

      protected void setDisabledExpression(String disabledExpression)
      Sets the disabled expression
      Parameters:
      disabledExpression -
    • setDisabledConditionJs

      protected void setDisabledConditionJs(String disabledConditionJs)
      Sets the disabled condition javascript
      Parameters:
      disabledConditionJs -
    • setDisabledConditionControlNames

      protected void setDisabledConditionControlNames(List<String> disabledConditionControlNames)
      Sets the disabled condition control names
      Parameters:
      disabledConditionControlNames -
    • 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