org.kuali.rice.krad.uif.control
Class ControlBase

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      extended by org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
          extended by org.kuali.rice.krad.uif.component.ComponentBase
              extended by org.kuali.rice.krad.uif.element.ContentElementBase
                  extended by org.kuali.rice.krad.uif.control.ControlBase
All Implemented Interfaces:
Serializable, DictionaryBean, UifDictionaryBean, Component, ScriptEventSupport, Control, ContentElement, org.springframework.core.Ordered
Direct Known Subclasses:
CheckboxControl, FileControl, HiddenControl, MultiValueControlBase, TextAreaControl, TextControl

public abstract class ControlBase
extends ContentElementBase
implements Control

Base class for all Control implementations

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Control, Serialized Form

Field Summary
 
Fields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
ControlBase()
           
 
Method Summary
 void completeValidation(ValidationTrace tracer)
          Validates different requirements of component compiling a series of reports detailing information on errors found in the component.
 String getComplexDataAttributesJs()
          Returns js that will add data to this component by the element which matches its id.
 String getComponentTypeName()
          The name for the component type
 List<String> getDisabledConditionControlNames()
          Control names to add handlers to for disable functionality, cannot be set
 String getDisabledConditionJs()
          Get the disable condition js derived from the springEL, cannot be set.
 String getDisabledReason()
          If the control is disabled, gives a reason for why which will be displayed as a tooltip on the control
 List<String> getDisabledWhenChangedPropertyNames()
          Gets the property names of fields that when changed, will disable this component
 List<String> getEnabledWhenChangedPropertyNames()
          Gets the property names of fields that when changed, will enable this component
 int getTabIndex()
          Unique index of the control within the tab order
 boolean isDisabled()
          Indicates whether the control is disabled (doesn't allow input)
 boolean isEvaluateDisabledOnKeyUp()
          Evaluate the disable condition on controls which disable it on each key up event
 void performApplyModel(View view, Object model, Component parent)
          Sets the disabledExpression, if any, evaluates it and sets the disabled property
 void performFinalize(View view, Object model, Component parent)
          Parses the disabled expressions, if any, to equivalent javascript and evaluates the disable/enable when changed property names.
 void setDisabled(boolean disabled)
          Setter for the disabled indicator
 void setDisabledReason(String disabledReason)
          Setter for the disabled reason text
 void setDisabledWhenChangedPropertyNames(List<String> disabledWhenChangedPropertyNames)
          Sets the property names of fields that when changed, will disable this component
 void setEnabledWhenChangedPropertyNames(List<String> enabledWhenChangedPropertyNames)
          Sets the property names of fields that when changed, will enable this component
 void setEvaluateDisabledOnKeyUp(boolean evaluateDisabledOnKeyUp)
          Set evaluateDisableOnKeyUp
 void setTabIndex(int tabIndex)
          Setter for the controls tab order index
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addCellCssClass, addDataAttribute, addDataAttributeIfNonEmpty, addStyleClass, appendToStyle, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAlign, getAllDataAttributesJs, getBaseId, getCellCssClasses, getCellStyle, getCellStyleClassesAsString, getCellWidth, getColSpan, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentSecurityClass, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, isSkipInTabOrder, performInitialization, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setMethodToCallOnRefresh, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setWidth
 
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Component
addCellCssClass, addDataAttribute, addStyleClass, appendToStyle, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAlign, getAllDataAttributesJs, getBaseId, getCellCssClasses, getCellStyle, getCellWidth, getColSpan, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getTemplate, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, performInitialization, pushAllToContext, pushObjectToContext, setAdditionalComponentsToRefresh, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, setId, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setStyle, setTemplate, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setWidth
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
getComponentCode, getNamespaceCode
 
Methods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnLoadScript
 

Constructor Detail

ControlBase

public ControlBase()
Method Detail

performApplyModel

public void performApplyModel(View view,
                              Object model,
                              Component parent)
Sets the disabledExpression, if any, evaluates it and sets the disabled property

Specified by:
performApplyModel in interface Component
Overrides:
performApplyModel in class ComponentBase
Parameters:
view - - view instance to which the component belongs
model - - Top level object containing the data (could be the form or a
parent -
See Also:
Component.performApplyModel(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component)

performFinalize

public void performFinalize(View view,
                            Object model,
                            Component parent)
Parses the disabled expressions, if any, to equivalent javascript and evaluates the disable/enable when changed property names.

Specified by:
performFinalize in interface Component
Overrides:
performFinalize in class ComponentBase
Parameters:
view - - view instance that should be finalized for rendering
model - - top level object containing the data
parent - - parent component
See Also:
Component.performFinalize(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component)

getComponentTypeName

public final String getComponentTypeName()
Description copied from interface: Component
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
See Also:
Component.getComponentTypeName()

getTabIndex

public int getTabIndex()
Description copied from interface: Control
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
See Also:
Control.getTabIndex()

setTabIndex

public void setTabIndex(int tabIndex)
Description copied from interface: Control
Setter for the controls tab order index

Specified by:
setTabIndex in interface Control
See Also:
Control.setTabIndex(int)

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:
Control.isDisabled()

setDisabled

public void setDisabled(boolean disabled)
Description copied from interface: Control
Setter for the disabled indicator

Specified by:
setDisabled in interface Control
See Also:
Control.setDisabled(boolean)

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:
Control.getDisabledReason()

setDisabledReason

public void setDisabledReason(String disabledReason)
Description copied from interface: Control
Setter for the disabled reason text

Specified by:
setDisabledReason in interface Control
See Also:
Control.setDisabledReason(java.lang.String)

getComplexDataAttributesJs

public String getComplexDataAttributesJs()
Returns js that will add data to this component by the element which matches its id.

This will return script for all the data elements since this component is implemented as a spring form:input tag that does not allow for the insertion of simple attributes. Therefore, the complex attributes script should include all the attributes since is it is inserted each time krad:template is used to display a control

Specified by:
getComplexDataAttributesJs in interface Component
Overrides:
getComplexDataAttributesJs in class ComponentBase
Returns:
jQuery data script for all data attributes

completeValidation

public void completeValidation(ValidationTrace tracer)
Description copied from interface: Component
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
See Also:
Component.completeValidation(org.kuali.rice.krad.datadictionary.validator.ValidationTrace)

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 -


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.