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
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:
-
Field Summary
Fields inherited from class org.kuali.rice.krad.uif.component.ComponentBase
templateOptionsFields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCodeFields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNo-op implementation.final StringThe name for the component typeLabelinstance for the fieldField Security object that indicates what authorization (permissions) exist for the fieldgetLabel()Label text for the fieldintLabel column span for the fieldLabel style classes for the fieldShort label for the fieldprotected voidInitializes (if necessary) the component security instance for the component typebooleanThe label for this field will be positioned to the left of the field content, when true.booleanIndicates whether the containedLabelhas been rendered as part of another field and thus should not be rendered with the attributevoidperformApplyModel(Object model, LifecycleElement parent) The following finalization is performed: Make sure that a label is defined for any data fields.voidperformFinalize(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 renderedvoidsetComponentSecurity(ComponentSecurity componentSecurity) Override to assert aFieldSecurityinstance is setvoidsetEditInLineAuthz(Boolean editInLineAuthz) voidsetFieldLabel(Label fieldLabel) Setter for the field's label fieldvoidSetter for the field's label textvoidsetLabelColSpan(int labelColSpan) Setter for the field's label column spanvoidsetLabelLeft(boolean labelLeft) voidsetLabelRendered(boolean labelRendered) Setter for the label field rendered indicatorvoidsetLabelStyleClasses(List<String> labelStyleClasses) Setter for the field's label style classesprotected voidsetNestedComponentIdAndSuffix(Component component, String suffix) Helper method for suffixing the ids of the fields nested componentsvoidsetShortLabel(String shortLabel) Setter for the field's short label textvoidsetShowLabel(boolean showLabel) Sets whether the label should be displayedvoidsetViewInLineAuthz(Boolean viewInLineAuthz) Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, checkMutable, clone, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getAriaAttributes, getAriaAttributesAsString, getCanCopyOnReadOnly, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContainerIdSuffix, getContext, getCssClasses, getCssGridSizes, getDataAttributes, getEventHandlerScript, getExcludeIf, getExcludeUnless, getFieldsToSendOnRefresh, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPhasePathMapping, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getReadOnly, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRole, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getViewPath, getViewStatus, getWidth, getWrapperCssClasses, getWrapperCssClassesAsString, getWrapperStyle, isDisableSessionPersistence, isDisclosedByAction, isEditAuthz, isFinal, isForceSessionPersistence, isHidden, isInitialized, isModelApplied, isMutable, isOmitFromFormPost, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isRefreshedByAction, isRender, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, isSkipInTabOrder, isViewAuthz, notifyCompleted, performInitialization, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setAriaAttributes, setCanCopyOnReadOnly, setCellWidth, setColSpan, setComponentModifiers, setConditionalRefresh, setContainerIdSuffix, setContext, setCssClasses, setCssGridSizes, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setEditAuthz, setExcludeIf, setExcludeUnless, setFieldsToSendOnRefresh, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOmitFromFormPost, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPhasePathMapping, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRole, setRowSpan, setScriptDataAttributes, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewAuthz, setViewPath, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyle, skipLifecycleMethods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressionsMethods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCodeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kuali.rice.krad.uif.component.Component
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getAriaAttributes, getAriaAttributesAsString, getCanCopyOnReadOnly, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getCssGridSizes, getDataAttributes, getEventHandlerScript, getExcludeIf, getExcludeUnless, getFieldsToSendOnRefresh, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getLibraryCssClasses, getMethodToCallOnRefresh, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getReadOnly, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRole, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, getWrapperCssClasses, getWrapperStyle, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isOmitFromFormPost, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isRefreshedByAction, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setAriaAttributes, setCanCopyOnReadOnly, setCellWidth, setColSpan, setComponentModifiers, setConditionalRefresh, setContext, setCssClasses, setCssGridSizes, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFieldsToSendOnRefresh, setForceSessionPersistence, setHidden, setLibraryCssClasses, setOmitFromFormPost, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRole, setRowSpan, setScriptDataAttributes, setSelfRendered, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyleMethods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCodeMethods inherited from interface org.kuali.rice.krad.uif.util.LifecycleElement
checkMutable, getContainerIdSuffix, getId, getPhasePathMapping, getViewPath, getViewStatus, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, performInitialization, pushAllToContext, pushObjectToContext, setContainerIdSuffix, setId, setPhasePathMapping, setRender, setViewPath, skipLifecycleMethods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScriptMethods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
-
Constructor Details
-
FieldBase
public FieldBase()
-
-
Method Details
-
performApplyModel
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.
- Evaluate the progressive render condition (if set) and combine with the current render status to set the render status
Where components can perform conditional logic such as dynamically generating new fields or setting field state based on the given data
- Specified by:
performApplyModelin interfaceLifecycleElement- Overrides:
performApplyModelin classComponentBase- 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:
afterEvaluateExpressionin interfaceComponent- Overrides:
afterEvaluateExpressionin classComponentBase
-
performFinalize
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
- 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
Here final preparations can be made based on the updated view state.
- Specified by:
performFinalizein interfaceLifecycleElement- Overrides:
performFinalizein classComponentBase- Parameters:
model- - top level object containing the dataparent- - parent component
-
setNestedComponentIdAndSuffix
Helper method for suffixing the ids of the fields nested components- Parameters:
component- component to adjust id forsuffix- suffix to append to id
-
getComponentTypeName
The name for the component typeThis 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:
getComponentTypeNamein interfaceComponent- Returns:
- String type name
-
getLabel
Description copied from interface:FieldLabel text for the fieldThe label is generally used to identify the field in the user interface
-
setLabel
Description copied from interface:FieldSetter for the field's label text -
getLabelStyleClasses
Description copied from interface:FieldLabel style classes for the field- Specified by:
getLabelStyleClassesin interfaceField- Returns:
- List<String> label style classes
- See Also:
-
setLabelStyleClasses
Description copied from interface:FieldSetter for the field's label style classes- Specified by:
setLabelStyleClassesin interfaceField- See Also:
-
getLabelColSpan
public int getLabelColSpan()Description copied from interface:FieldLabel column span for the field- Specified by:
getLabelColSpanin interfaceField- Returns:
- int label column span
- See Also:
-
setLabelColSpan
public void setLabelColSpan(int labelColSpan) Description copied from interface:FieldSetter for the field's label column span- Specified by:
setLabelColSpanin interfaceField- See Also:
-
getShortLabel
Description copied from interface:FieldShort label for the fieldFor 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:
getShortLabelin interfaceField- Returns:
- String short label
- See Also:
-
setShortLabel
Description copied from interface:FieldSetter for the field's short label text- Specified by:
setShortLabelin interfaceField- Parameters:
shortLabel-- See Also:
-
setShowLabel
public void setShowLabel(boolean showLabel) Sets whether the label should be displayedConvenience method for configuration that sets the hidden indicator on the fields
Labelinstance. 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
Description copied from interface:FieldLabelinstance for the fieldThe 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:
getFieldLabelin interfaceField- Returns:
- Label instance
- See Also:
-
setFieldLabel
Description copied from interface:FieldSetter for the field's label field- Specified by:
setFieldLabelin interfaceField- 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:
isLabelLeftin interfaceField
-
setLabelLeft
public void setLabelLeft(boolean labelLeft) - Specified by:
setLabelLeftin interfaceField- See Also:
-
isLabelRendered
public boolean isLabelRendered()Description copied from interface:FieldIndicates whether the containedLabelhas been rendered as part of another field and thus should not be rendered with the attribute- Specified by:
isLabelRenderedin interfaceField- 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:FieldSetter for the label field rendered indicator- Specified by:
setLabelRenderedin interfaceField- See Also:
-
getFieldSecurity
Description copied from interface:FieldField Security object that indicates what authorization (permissions) exist for the field- Specified by:
getFieldSecurityin interfaceField- Returns:
- FieldSecurity instance
- See Also:
-
setComponentSecurity
Override to assert aFieldSecurityinstance is set- Specified by:
setComponentSecurityin interfaceComponent- Overrides:
setComponentSecurityin classComponentBase- Parameters:
componentSecurity- instance of FieldSecurity
-
initializeComponentSecurity
protected void initializeComponentSecurity()Initializes (if necessary) the component security instance for the component type- Overrides:
initializeComponentSecurityin classComponentBase
-
isEditInLineAuthz
- See Also:
-
setEditInLineAuthz
- See Also:
-
isViewInLineAuthz
- See Also:
-
setViewInLineAuthz
- See Also:
-