|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.datadictionary.DictionaryBeanBase org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase org.kuali.rice.krad.uif.component.ComponentBase org.kuali.rice.krad.uif.field.FieldBase org.kuali.rice.krad.uif.field.DataField
public class DataField
Field that renders data from the application, such as the value of a data object property
Field Summary | |
---|---|
protected String |
readOnlyDisplayReplacementPropertyName
|
protected String |
readOnlyDisplaySuffixPropertyName
|
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 | |
---|---|
DataField()
|
Method Summary | ||
---|---|---|
protected void |
buildAutomaticInquiry(View view,
Object model,
boolean enableDirectInquiry)
Creates a new Inquiry and then invokes the lifecycle process for
the inquiry to determine if a relationship was found, if so the inquiry is assigned to the field |
|
void |
completeValidation(ValidationTrace tracer)
Validates different requirements of component compiling a series of reports detailing information on errors found in the component. |
|
void |
copyFromAttributeDefinition(View view,
AttributeDefinition attributeDefinition)
Defaults the properties of the DataField to the
corresponding properties of its AttributeDefinition
retrieved from the dictionary (if such an entry exists). |
|
protected
|
copyProperties(T component)
Copies the properties over for the copy method |
|
protected String |
generateReadOnlyListDisplayReplacement(List<?> list)
Generates the html to be used and sets the readOnlyDisplayReplacement for DataFields that contain lists and do not have their own readOnlyDisplayReplacement defined. |
|
List<String> |
getAdditionalHiddenPropertyNames()
Allows specifying hidden property names without having to specify as a field in the group config (that might impact layout) |
|
BindingInfo |
getBindingInfo()
Returns the BindingInfo instance that is configured for the
component |
|
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 |
|
DataFieldSecurity |
getDataFieldSecurity()
Data Field Security object that indicates what authorization (permissions) exist for the field |
|
String |
getDefaultValue()
Default value for the model property the field points to |
|
Class<? extends ValueFinder> |
getDefaultValueFinderClass()
Gives Class that should be invoked to produce the default value for the field |
|
Object[] |
getDefaultValues()
Array of default values for the model property the field points to |
|
String |
getDictionaryAttributeName()
Name of the attribute within the data dictionary the attribute field is associated with |
|
String |
getDictionaryObjectEntry()
Object entry name in the data dictionary the associated attribute is apart of |
|
String |
getForcedValue()
|
|
Help |
getHelp()
Help configuration object for the datafield |
|
String |
getHelpSummary()
Summary help text for the field |
|
String |
getHelpTitle()
Return the field label for the help title |
|
Inquiry |
getInquiry()
Inquiry widget for the field |
|
MaskFormatter |
getMaskFormatter()
MaskFormatter instance that will be used to mask the field value when isApplyMask() is true |
|
String |
getName()
Returns the full binding path (the path used in the name attribute of the input). |
|
PropertyEditor |
getPropertyEditor()
Performs formatting of the field value for display and then converting the value back to its expected type from a string |
|
String |
getPropertyName()
Name of the property (relative to the parent object) the component binds to |
|
List<String> |
getPropertyNamesForAdditionalDisplay()
List of property names whose values should be displayed read-only under this field |
|
String |
getReadOnlyDisplayReplacement()
Returns the alternate display value |
|
String |
getReadOnlyDisplayReplacementPropertyName()
Returns the alternate display attribute name to be displayed when the field is readonly. |
|
String |
getReadOnlyDisplaySuffix()
Returns the additional display value. |
|
String |
getReadOnlyDisplaySuffixPropertyName()
Returns the additional display attribute name to be displayed when the field is readonly |
|
String |
getReadOnlyListDelimiter()
The readOnlyListDelimiter is used to set the delimiter used when "DELIMITED" type is set for readOnlyListDisplayType |
|
String |
getReadOnlyListDisplayType()
Gets the readOnlyListDisplayType. |
|
boolean |
hasSecureValue()
Indicates whether the value for the field is secure |
|
boolean |
isAddHiddenWhenReadOnly()
Indicates the field should be read-only but also a hidden should be generated for the field |
|
boolean |
isApplyMask()
Indicates whether the value for the field should be masked (or partially masked) on display |
|
boolean |
isEnableAutoInquiry()
Indicates whether inquiries should be automatically set when a relationship for the field's property is found |
|
boolean |
isEscapeHtmlInPropertyValue()
Returns true if HTML escape allowed for this field |
|
boolean |
isInputAllowed()
Indicates whether the data field instance allows input, subclasses should override and set to true if input is allowed |
|
boolean |
isMultiLineReadOnlyDisplay()
Returns true if this field is of type TextAreaControl . |
|
boolean |
isRenderFieldset()
|
|
void |
performApplyModel(View view,
Object model,
Component parent)
The following updates are done here: If readOnlyHidden set to true, set field to readonly and add to hidden property names |
|
void |
performFinalize(View view,
Object model,
Component parent)
The following actions are performed: Set the ids for the various attribute components Sets up the client side validation for constraints on this field. |
|
void |
performInitialization(View view,
Object model)
The following initialization is performed: Set defaults for binding Default the model path if not set |
|
protected void |
processReadOnlyListDisplay(Object model,
List<?> originalList)
This method is called when the list is readOnly as determined in DataField's performFinalize method. |
|
void |
setAddHiddenWhenReadOnly(boolean addHiddenWhenReadOnly)
Setter for the read-only hidden indicator |
|
void |
setAdditionalHiddenPropertyNames(List<String> additionalHiddenPropertyNames)
Setter for the hidden property names |
|
protected void |
setAlternateAndAdditionalDisplayValue(View view,
Object model)
Sets alternate and additional property value for this field. |
|
void |
setApplyMask(boolean applyMask)
Setter for the apply value mask flag |
|
void |
setBindingInfo(BindingInfo bindingInfo)
Setter for the field's binding info |
|
void |
setComponentSecurity(ComponentSecurity componentSecurity)
Override to assert a DataFieldSecurity instance is set |
|
void |
setDefaultValue(String defaultValue)
Setter for the fields default value |
|
void |
setDefaultValueFinderClass(Class<? extends ValueFinder> defaultValueFinderClass)
Setter for the default value finder class |
|
void |
setDefaultValues(Object[] defaultValues)
Setter for the fields default values |
|
void |
setDictionaryAttributeName(String dictionaryAttributeName)
Setter for the dictionary attribute name |
|
void |
setDictionaryObjectEntry(String dictionaryObjectEntry)
Setter for the dictionary object entry |
|
void |
setEnableAutoInquiry(boolean enableAutoInquiry)
Setter for enabling automatic inquiries |
|
void |
setEscapeHtmlInPropertyValue(boolean escapeHtmlInPropertyValue)
Sets HTML escaping for this property value. |
|
void |
setForcedValue(String forcedValue)
|
|
void |
setHelp(Help help)
Setter for the datafield help content |
|
void |
setHelpSummary(String helpSummary)
Setter for the summary help text |
|
void |
setInquiry(Inquiry inquiry)
Setter for the inquiry widget |
|
void |
setMaskFormatter(MaskFormatter maskFormatter)
Setter for the MaskFormatter instance to apply when the value is masked |
|
void |
setMultiLineReadOnlyDisplay(boolean multiLineReadOnlyDisplay)
Setter for multiLineReadOnlyDisplay |
|
void |
setPropertyEditor(PropertyEditor propertyEditor)
Setter for the custom property editor to use for the field |
|
void |
setPropertyEditorClass(Class<? extends PropertyEditor> propertyEditorClass)
Convenience setter for configuring a property editor by class |
|
void |
setPropertyName(String propertyName)
Setter for the component's property name |
|
void |
setPropertyNamesForAdditionalDisplay(List<String> propertyNamesForAdditionalDisplay)
Setter for the list of informational property names |
|
void |
setReadOnlyDisplayReplacement(String value)
Setter for the alternative display value |
|
void |
setReadOnlyDisplayReplacementPropertyName(String readOnlyDisplayReplacementPropertyName)
Sets the alternate display attribute name to be displayed when the field is readonly. |
|
void |
setReadOnlyDisplaySuffix(String value)
Setter for the additional display value |
|
void |
setReadOnlyDisplaySuffixPropertyName(String readOnlyDisplaySuffixPropertyName)
Additional display attribute name, which will be displayed next to the actual field value when the field is readonly with hyphen in between like PropertyValue - AdditionalPropertyValue |
|
void |
setReadOnlyListDelimiter(String readOnlyListDelimiter)
Set the readOnlyListDelimiter |
|
void |
setReadOnlyListDisplayType(String readOnlyListDisplayType)
Set the readOnlyListDisplayType |
|
void |
setTooltipOfComponent(Tooltip tooltip)
For data fields the help tooltip is placed on the label. |
Methods inherited from class org.kuali.rice.krad.uif.field.FieldBase |
---|
getComponentTypeName, getFieldLabel, getFieldSecurity, getLabel, getLabelColSpan, getLabelPlacement, getLabelStyleClasses, getShortLabel, isLabelRendered, setFieldLabel, setLabel, setLabelColSpan, setLabelPlacement, setLabelRendered, setLabelStyleClasses, setNestedComponentIdAndSuffix, setShortLabel, setShowLabel |
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.datadictionary.uif.UifDictionaryBean |
---|
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph |
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean |
---|
getComponentCode, getNamespaceCode |
Field Detail |
---|
protected String readOnlyDisplayReplacementPropertyName
protected String readOnlyDisplaySuffixPropertyName
Constructor Detail |
---|
public DataField()
Method Detail |
---|
public void performInitialization(View view, Object model)
performInitialization
in interface Component
performInitialization
in class FieldBase
view
- - view instance in which the component belongsmodel
- - object instance containing the view dataComponentBase.performInitialization(org.kuali.rice.krad.uif.view.View,
java.lang.Object)
public void performApplyModel(View view, Object model, Component parent)
performApplyModel
in interface Component
performApplyModel
in class ComponentBase
view
- - view instance to which the component belongsmodel
- - Top level object containing the data (could be the form or a
top level business object, dto)Component.performApplyModel(org.kuali.rice.krad.uif.view.View,
java.lang.Object, org.kuali.rice.krad.uif.component.Component)
public void performFinalize(View view, Object model, Component parent)
performFinalize
in interface Component
performFinalize
in class FieldBase
view
- - view instance that should be finalized for renderingmodel
- - top level object containing the dataparent
- - parent componentComponentBase.performFinalize(org.kuali.rice.krad.uif.view.View,
java.lang.Object, org.kuali.rice.krad.uif.component.Component)
protected void buildAutomaticInquiry(View view, Object model, boolean enableDirectInquiry)
Inquiry
and then invokes the lifecycle process for
the inquiry to determine if a relationship was found, if so the inquiry is assigned to the field
view
- view instance being processedmodel
- object containing the view dataenableDirectInquiry
- whether direct inquiry should be enabled if an inquiry is foundprotected void processReadOnlyListDisplay(Object model, List<?> originalList)
model
- the modeloriginalList
- originalList of valuesprotected String generateReadOnlyListDisplayReplacement(List<?> list)
list
- the list to be converted to readOnly htmlprotected void setAlternateAndAdditionalDisplayValue(View view, Object model)
If AttributeSecurity
present in this field, make sure the current user has permission to view the
field value. If user doesn't have permission to view the value, mask the value as configured and set it
as alternate value for display. If security doesn't exists for this field but
alternateDisplayPropertyName
present, get its value and format it based on that
fields formatting and set for display.
For additional display value, if AttributeSecurity
not present, sets the value if
additionalDisplayPropertyName
present. If not present, check whether this field is a
KualiCode
and get the relationship configured in the datadictionary file and set the name
additional display value which will be displayed along with the code. If additional display property not
present, check whether this field is has MultiValueControlBase
. If yes, get the Label
for the value and set it as additional display value.
view
- the current view instancemodel
- model instancepublic void copyFromAttributeDefinition(View view, AttributeDefinition attributeDefinition)
DataField
to the
corresponding properties of its AttributeDefinition
retrieved from the dictionary (if such an entry exists). If the field
already contains a value for a property, the definitions value is not
used.
view
- view instance the field belongs toattributeDefinition
- AttributeDefinition instance the property values should be
copied frompublic List<Component> getComponentsForLifecycle()
Component
Used by ViewHelperService
for the various lifecycle callbacks
getComponentsForLifecycle
in interface Component
getComponentsForLifecycle
in class FieldBase
ComponentBase.getComponentsForLifecycle()
public boolean isInputAllowed()
public String getPropertyName()
DataBinding
getPropertyName
in interface DataBinding
DataBinding.getPropertyName()
public void setPropertyName(String propertyName)
propertyName
- public PropertyEditor getPropertyEditor()
Note property editors exist and are already registered for the basic Java types and the common Kuali types such as [@link KualiDecimal}. Registration with this property is only needed for custom property editors
public void setPropertyEditor(PropertyEditor propertyEditor)
propertyEditor
- public void setPropertyEditorClass(Class<? extends PropertyEditor> propertyEditorClass)
propertyEditorClass
- public BindingInfo getBindingInfo()
DataBinding
BindingInfo
instance that is configured for the
component
getBindingInfo
in interface DataBinding
DataBinding.getBindingInfo()
public void setBindingInfo(BindingInfo bindingInfo)
setBindingInfo
in interface DataBinding
bindingInfo
- public String getName()
public String getDictionaryAttributeName()
During the initialize phase for the View
, properties for
attribute fields are defaulted from a corresponding
AttributeDefinition
in the data dictionary. Based on the
propertyName and parent object class the framework attempts will
determine the attribute definition that is associated with the field and
set this property. However this property can also be set in the fields
configuration to use another dictionary attribute.
The attribute name is used along with the dictionary object entry to find
the AttributeDefinition
public void setDictionaryAttributeName(String dictionaryAttributeName)
dictionaryAttributeName
- public String getDictionaryObjectEntry()
During the initialize phase for the View
, properties for
attribute fields are defaulted from a corresponding
AttributeDefinition
in the data dictionary. Based on the
parent object class the framework will determine the object entry for the
associated attribute. However the object entry can be set in the field's
configuration to use another object entry for the attribute
The attribute name is used along with the dictionary object entry to find
the AttributeDefinition
public void setDictionaryObjectEntry(String dictionaryObjectEntry)
dictionaryObjectEntry
- public String getDefaultValue()
When a new View
instance is requested, the corresponding
model will be newly created. During this initialization process the value
for the model property will be set to the given default value, if it was null.
This will only work on properties which can be determined to be null.
Therefore a String property with an empty string value will
not be ovewritten with the defaultValue set here.
In addition, int, boolean, and other primitive types will not use this default value because they inherently have a value in Java (0 for int, false for boolean, etc). To use such types either using a primitive wrapper type (Integer, Boolean, etc) so an unset variable can be determined to be null, or explicitly set the default value on the form/object itself for these types and not through this property.
public void setDefaultValue(String defaultValue)
defaultValue
- public Class<? extends ValueFinder> getDefaultValueFinderClass()
public void setDefaultValueFinderClass(Class<? extends ValueFinder> defaultValueFinderClass)
defaultValueFinderClass
- public Object[] getDefaultValues()
When a new View
instance is requested, the corresponding
model will be newly created. During this initialization process the value
for the model property will be set to the given default values (if set)
public void setDefaultValues(Object[] defaultValues)
defaultValues
- public String getForcedValue()
public void setForcedValue(String forcedValue)
public String getHelpSummary()
public void setHelpSummary(String helpSummary)
helpSummary
- public DataFieldSecurity getDataFieldSecurity()
public void setComponentSecurity(ComponentSecurity componentSecurity)
DataFieldSecurity
instance is set
setComponentSecurity
in interface Component
setComponentSecurity
in class FieldBase
componentSecurity
- instance of DataFieldSecurityComponent.setComponentSecurity(org.kuali.rice.krad.uif.component.ComponentSecurity)
protected Class<? extends ComponentSecurity> getComponentSecurityClass()
ComponentBase
getComponentSecurityClass
in class FieldBase
ComponentBase.getComponentSecurityClass()
public boolean isAddHiddenWhenReadOnly()
Useful for when a value is just displayed but is needed by script
public void setAddHiddenWhenReadOnly(boolean addHiddenWhenReadOnly)
addHiddenWhenReadOnly
- public Inquiry getInquiry()
The inquiry widget will render a link for the field value when read-only
that points to the associated inquiry view for the field. The inquiry can
be configured to point to a certain InquiryView
, or the
framework will attempt to associate the field with a inquiry based on its
metadata (in particular its relationships in the model)
public void setInquiry(Inquiry inquiry)
inquiry
- public boolean isEnableAutoInquiry()
Note this only applies when the getInquiry()
widget has not been configured (is null)
and is set to true by default
public void setEnableAutoInquiry(boolean enableAutoInquiry)
enableAutoInquiry
- public Help getHelp()
External help information can be configured for the datafield. The
Help
object can the configuration for rendering a link to
that help information.
getHelp
in interface Helpable
public void setHelp(Help help)
setHelp
in interface Helpable
help
- public void setTooltipOfComponent(Tooltip tooltip)
setTooltipOfComponent
in interface Helpable
org.kuali.rice.krad.uif.widget.Helpable#setTooltipOfComponent(org.kuali.rice.krad.uif.widget.Tooltip))
public String getHelpTitle()
getHelpTitle
in interface Helpable
Helpable.setTooltipOfComponent(org.kuali.rice.krad.uif.widget.Tooltip)
public void setReadOnlyDisplaySuffixPropertyName(String readOnlyDisplaySuffixPropertyName)
readOnlyDisplaySuffixPropertyName
- name of the additional display propertypublic String getReadOnlyDisplaySuffixPropertyName()
public void setReadOnlyDisplayReplacementPropertyName(String readOnlyDisplayReplacementPropertyName)
readOnlyDisplayReplacementPropertyName
- alternate display property namepublic String getReadOnlyDisplayReplacementPropertyName()
public String getReadOnlyDisplayReplacement()
public void setReadOnlyDisplayReplacement(String value)
value
- public String getReadOnlyDisplaySuffix()
public void setReadOnlyDisplaySuffix(String value)
value
- public String getReadOnlyListDisplayType()
When this is not set, the list will default to the delimited list display with a default of comma and space (", ") - if readOnlyListDelimiter is not set as well. The type can be set as the following:
public void setReadOnlyListDisplayType(String readOnlyListDisplayType)
readOnlyListDisplayType
- public String getReadOnlyListDelimiter()
public void setReadOnlyListDelimiter(String readOnlyListDelimiter)
readOnlyListDelimiter
- public boolean isApplyMask()
If set to true, the field value will be masked by applying the configured getMaskFormatter()
If a KIM permission exists that should be checked to determine whether the value should be masked or not,
this value should not be set but instead the mask or partialMask property on ComponentBase.getComponentSecurity()
should be set to true. This indicates there is a mask permission that should be consulted. If the user
does not have the permission, this flag will be set to true by the framework and the value masked using
the mask formatter configured on the security object
public void setApplyMask(boolean applyMask)
applyMask
- public MaskFormatter getMaskFormatter()
isApplyMask()
is true
Note in cases where the mask is applied due to security (KIM permissions), the mask or partial mask formatter
configured on ComponentBase.getComponentSecurity()
will be used instead of this mask formatter
public void setMaskFormatter(MaskFormatter maskFormatter)
maskFormatter
- public List<String> getAdditionalHiddenPropertyNames()
public void setAdditionalHiddenPropertyNames(List<String> additionalHiddenPropertyNames)
additionalHiddenPropertyNames
- public List<String> getPropertyNamesForAdditionalDisplay()
In the attribute field template for each information property name given its values is outputted read-only. Informational property values can also be updated dynamically with the use of field attribute query
Simple property names can be given if the property has the same binding parent as this field, in which case the binding path will be adjusted by the framework. If the property names starts with org.kuali.rice.krad.uif.UifConstants#NO_BIND_ADJUST_PREFIX, no binding prefix will be added.
public void setPropertyNamesForAdditionalDisplay(List<String> propertyNamesForAdditionalDisplay)
propertyNamesForAdditionalDisplay
- public void setEscapeHtmlInPropertyValue(boolean escapeHtmlInPropertyValue)
public boolean isEscapeHtmlInPropertyValue()
public boolean isMultiLineReadOnlyDisplay()
TextAreaControl
.
Used to preserve text formatting in a textarea when the view is readOnly by enclosing the text in a tag.
TextAreaControl
public void setMultiLineReadOnlyDisplay(boolean multiLineReadOnlyDisplay)
multiLineReadOnlyDisplay
- public boolean hasSecureValue()
A value will be secured if masking has been applied (by configuration or a failed KIM permission) or the field has been marked as hidden due to an authorization check
public boolean isRenderFieldset()
public void completeValidation(ValidationTrace tracer)
Component
completeValidation
in interface Component
completeValidation
in class ComponentBase
tracer
- Record of component's locationComponent.completeValidation(org.kuali.rice.krad.datadictionary.validator.ValidationTrace)
protected <T> void copyProperties(T component)
ComponentBase
copyProperties
in class FieldBase
component
- base beanComponentBase.copy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |