org.kuali.rice.krad.uif.field
Class FieldBase

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.field.FieldBase
All Implemented Interfaces:
Serializable, Cloneable, DictionaryBean, UifDictionaryBean, Component, ScriptEventSupport, Field, org.springframework.core.Ordered
Direct Known Subclasses:
ActionField, DataField, FieldGroup, GenericField, ImageField, LinkField, MessageField, 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:
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
FieldBase()
           
 
Method Summary
protected
<T> void
copyProperties(T component)
          Copies the properties over for the copy method
protected  Class<? extends ComponentSecurity> getComponentSecurityClass()
          Returns the security class that is associated with the component (used for initialization and validation)
 List<Component> getComponentsForLifecycle()
          List of components that are contained within the component and should be sent through the lifecycle
 String getComponentTypeName()
          The name for the component type
 Label getFieldLabel()
          Label instance for the field
 FieldSecurity getFieldSecurity()
          Field Security object that indicates what authorization (permissions) exist for the field
 String getLabel()
          Label text for the field
 int getLabelColSpan()
          Label column span for the field
 UifConstants.Position getLabelPlacement()
          Indicates where the label is placed in relation to the field (valid options are LEFT, RIGHT, BOTTOM, and TOP
 List<String> getLabelStyleClasses()
          Label style classes for the field
 String getShortLabel()
          Short label for the field
 boolean isLabelRendered()
          Indicates whether the contained Label has been rendered as part of another field and thus should not be rendered with the attribute
 void performFinalize(View view, Object model, Component 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 If label placement is right, set render colon to false
 void performInitialization(View view, Object model)
          The following initialization is performed:
 void setComponentSecurity(ComponentSecurity componentSecurity)
          Override to assert a FieldSecurity instance is set
 void setFieldLabel(Label fieldLabel)
          Setter for the field's label field
 void setLabel(String labelText)
          Setter for the field's label text
 void setLabelColSpan(int labelColSpan)
          Setter for the field's label column span
 void setLabelPlacement(UifConstants.Position labelPlacement)
          Setter for the label's position in relation to the field (control if editable)
 void setLabelRendered(boolean labelRendered)
          Setter for the label field rendered indicator
 void setLabelStyleClasses(List<String> labelStyleClasses)
          Setter for the field's label style classes
protected  void setNestedComponentIdAndSuffix(Component component, String suffix)
          Helper method for suffixing the ids of the fields nested components
 void setShortLabel(String shortLabel)
          Setter for the field's short label text
 void setShowLabel(boolean showLabel)
          Sets whether the label should be displayed
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addCellCssClass, addDataAttribute, addDataAttributeIfNonEmpty, addStyleClass, appendToStyle, completeValidation, copy, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getBaseId, getCellCssClasses, getCellStyle, getCellStyleClassesAsString, getCellWidth, getColSpan, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPostRenderContent, getPreRenderContent, 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, isRetrieveViaAjax, isSelfRendered, isSkipInTabOrder, performApplyModel, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, 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, completeValidation, copy, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getBaseId, getCellCssClasses, getCellStyle, getCellWidth, getColSpan, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, performApplyModel, pushAllToContext, pushObjectToContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRowSpan, setSelfRendered, setStyle, setTemplate, setTemplateName, 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, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript
 

Constructor Detail

FieldBase

public FieldBase()
Method Detail

performInitialization

public void performInitialization(View view,
                                  Object model)
The following initialization is performed:

Specified by:
performInitialization in interface Component
Overrides:
performInitialization in class ComponentBase
Parameters:
view - - view instance in which the component belongs
model - - object instance containing the view data
See Also:
ComponentBase.performInitialization(org.kuali.rice.krad.uif.view.View, java.lang.Object)

performFinalize

public void performFinalize(View view,
                            Object model,
                            Component parent)
The following finalization is performed:

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:
ComponentBase.performFinalize(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.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()
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
Returns:
String type name
See Also:
Component.getComponentTypeName()

getComponentsForLifecycle

public List<Component> getComponentsForLifecycle()
Description copied from interface: Component
List of components that are contained within the component and should be sent through the lifecycle

Used by ViewHelperService for the various lifecycle callbacks

Specified by:
getComponentsForLifecycle in interface Component
Overrides:
getComponentsForLifecycle in class ComponentBase
Returns:
List child components
See Also:
ComponentBase.getComponentsForLifecycle()

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:
Field.getLabel()

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:
Field.setLabel(java.lang.String)

getLabelStyleClasses

public List<String> getLabelStyleClasses()
Description copied from interface: Field
Label style classes for the field

Specified by:
getLabelStyleClasses in interface Field
Returns:
List label style classes
See Also:
Field.getLabelStyleClasses()

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:
Field.setLabelStyleClasses(java.util.List)

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:
Field.getLabelColSpan()

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:
Field.setLabelColSpan(int)

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:
Field.getShortLabel()

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
See Also:
Field.setShortLabel(java.lang.String)

setShowLabel

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

Convenience method for configuration that sets the render indicator on the fields Label instance

Parameters:
showLabel - true if label should be displayed, false if the label should not be displayed

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:
Field.getLabel()

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:
Field.setFieldLabel(org.kuali.rice.krad.uif.element.Label)

getLabelPlacement

public UifConstants.Position getLabelPlacement()
Indicates where the label is placed in relation to the field (valid options are LEFT, RIGHT, BOTTOM, and TOP

Returns:
position of label

setLabelPlacement

public void setLabelPlacement(UifConstants.Position labelPlacement)
Setter for the label's position in relation to the field (control if editable)

Parameters:
labelPlacement -

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:
Field.isLabelRendered()

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:
Field.setLabelRendered(boolean)

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:
Field.getFieldSecurity()

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
See Also:
Component.setComponentSecurity(org.kuali.rice.krad.uif.component.ComponentSecurity)

getComponentSecurityClass

protected Class<? extends ComponentSecurity> getComponentSecurityClass()
Description copied from class: ComponentBase
Returns the security class that is associated with the component (used for initialization and validation)

Overrides:
getComponentSecurityClass in class ComponentBase
Returns:
Class
See Also:
ComponentBase.getComponentSecurityClass()

copyProperties

protected <T> void copyProperties(T component)
Description copied from class: ComponentBase
Copies the properties over for the copy method

Overrides:
copyProperties in class ComponentBase
Parameters:
component - base bean
See Also:
ComponentBase.copy()


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