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, 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  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, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAlign, getAllDataAttributesJs, getBaseId, getCellCssClasses, getCellStyle, getCellStyleClassesAsString, getCellWidth, getColSpan, getComplexDataAttributesJs, getComponentModifiers, getComponentPrototypes, getComponentSecurity, 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, performApplyModel, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, 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, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAlign, getAllDataAttributesJs, getBaseId, getCellCssClasses, getCellStyle, getCellWidth, getColSpan, getComplexDataAttributesJs, getComponentModifiers, getComponentPrototypes, getComponentSecurity, 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, performApplyModel, pushAllToContext, pushObjectToContext, setAdditionalComponentsToRefresh, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, 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

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:
org.kuali.rice.krad.uif.field.Field#setFieldLabel(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 - boolean 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 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()


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