|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.rice.krad.uif.component.ConfigurableBase
org.kuali.rice.krad.uif.component.ComponentBase
org.kuali.rice.krad.uif.field.FieldBase
org.kuali.rice.krad.uif.field.AttributeField
public class AttributeField
Field that encapsulates data input/output captured by an attribute within the application
The AttributField
provides the majority of the data input/output
for the screen. Through these fields the model can be displayed and updated.
For data input, the field contains a Control
instance will
render an HTML control element(s). The attribute field also contains a
LabelField
, summary, and widgets such as a quickfinder (for
looking up values) and inquiry (for getting more information on the value).
AttributeField
instances can have associated messages (errors)
due to invalid input or business rule failures. Security can also be
configured to restrict who may view the fields value.
Field Summary | |
---|---|
protected String |
additionalDisplayPropertyName
|
protected String |
alternateDisplayPropertyName
|
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 | |
---|---|
AttributeField()
|
Method Summary | |
---|---|
void |
copyFromAttributeDefinition(AttributeDefinition attributeDefinition)
Defaults the properties of the AttributeField to the
corresponding properties of its AttributeDefinition
retrieved from the dictionary (if such an entry exists). |
String |
getAdditionalDisplayPropertyName()
Returns the additional display attribute name to be displayed when the field is readonly |
String |
getAdditionalDisplayValue()
Returns the additional display value. |
String |
getAlternateDisplayPropertyName()
Returns the alternate display attribute name to be displayed when the field is readonly. |
String |
getAlternateDisplayValue()
Returns the alternate display value |
AttributeSecurity |
getAttributeSecurity()
Holds security configuration for the attribute field. |
BindingInfo |
getBindingInfo()
Returns the BindingInfo instance that is configured for the
component |
CaseConstraint |
getCaseConstraint()
|
String |
getConstraint()
Returns the contraint set on the field |
MessageField |
getConstraintMessageField()
Returns the contraint message field. |
Control |
getControl()
Control instance that should be used to input data 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 |
List<PrerequisiteConstraint> |
getDependencyConstraints()
|
String |
getDescription()
Full explanation of the field (attribute). |
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 |
getErrorMessagePlacement()
|
ErrorsField |
getErrorsField()
Field that contains the messages (errors) for the attribute field. |
String |
getExclusiveMin()
The exclusiveMin element determines the minimum allowable value for data entry editing purposes. |
AttributeQuery |
getFieldAttributeQuery()
Attribute query instance configured for this field to dynamically pull information back for updates other fields or providing messages |
DirectInquiry |
getFieldDirectInquiry()
DirectInquiry widget for the field |
Inquiry |
getFieldInquiry()
Inquiry widget for the field |
QuickFinder |
getFieldLookup()
Lookup finder widget for the field |
Suggest |
getFieldSuggest()
Suggest box widget for the attribute field |
Formatter |
getFormatter()
Formatter instance that should be used when displaying and
accepting the field's value in the user interface |
List<String> |
getHiddenPropertyNames()
Allows specifying hidden property names without having to specify as a field in the group config (that might impact layout) |
String |
getInclusiveMax()
The inclusiveMax element determines the maximum allowable value for data entry editing purposes. |
List<String> |
getInformationalDisplayPropertyNames()
List of property names whose values should be displayed read-only under this field |
Integer |
getMaxLength()
Maximum number of the characters the attribute value is allowed to have. |
Integer |
getMinLength()
|
List<MustOccurConstraint> |
getMustOccurConstraints()
|
List<Component> |
getNestedComponents()
List of components that are contained within the component |
KeyValuesFinder |
getOptionsFinder()
Instance of KeyValluesFinder that should be invoked to
provide a List of values the field can have. |
String |
getPropertyName()
Name of the property (relative to the parent object) the component binds to |
Boolean |
getRequired()
Indicates whether the component is required |
SimpleConstraint |
getSimpleConstraint()
A simple constraint which store the values for required, min/max length, and min/max value |
String |
getSummary()
Brief statement of the field (attribute) purpose. |
MessageField |
getSummaryMessageField()
|
boolean |
getSupportsOnLoad()
Indicates whether the component supports the onLoad event |
ValidCharactersConstraint |
getValidCharactersConstraint()
Valid character constraint that defines regular expressions for the valid characters for this field |
boolean |
isEscapeHtmlInPropertyValue()
Returns true if HTML escape allowed for this field |
boolean |
isPerformUppercase()
Perform uppercase flag for this field to force input to uppercase. |
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)
The following initialization is performed: Set defaults for binding Default the model path if not set |
void |
setAdditionalDisplayPropertyName(String additionalDisplayPropertyName)
Additional display attribute name, which will be displayed next to the actual field value when the field is readonly with hypen inbetween like PropertyValue - AdditionalPropertyValue |
protected void |
setAlternateAndAdditionalDisplayValue(View view,
Object model)
Sets alternate and additional property value for this field. |
void |
setAlternateDisplayPropertyName(String alternateDisplayPropertyName)
Sets the alternate display attribute name to be displayed when the field is readonly. |
void |
setAttributeSecurity(AttributeSecurity attributeSecurity)
Setter for the AttributeSecurity instance that defines restrictions for the field |
void |
setBindingInfo(BindingInfo bindingInfo)
Setter for the field's binding info |
void |
setCaseConstraint(CaseConstraint caseConstraint)
|
void |
setConstraint(String constraint)
Sets the constraint text. |
void |
setConstraintMessageField(MessageField constraintMessageField)
Sets the constraint message field. |
void |
setControl(Control control)
Setter for the field's control |
void |
setDefaultValue(String defaultValue)
Setter for the fields default value |
void |
setDefaultValueFinderClass(Class<? extends ValueFinder> defaultValueFinderClass)
Setter for the default value finder class |
void |
setDependencyConstraints(List<PrerequisiteConstraint> dependencyConstraints)
|
void |
setDescription(String description)
Setter for the description message |
void |
setDictionaryAttributeName(String dictionaryAttributeName)
Setter for the dictionary attribute name |
void |
setDictionaryObjectEntry(String dictionaryObjectEntry)
Setter for the dictionary object entry |
void |
setErrorMessagePlacement(String errorMessagePlacement)
|
void |
setErrorsField(ErrorsField errorsField)
Setter for the attribute field's errors field |
void |
setEscapeHtmlInPropertyValue(boolean escapeHtmlInPropertyValue)
Sets HTML escaping for this property value. |
void |
setExclusiveMin(String exclusiveMin)
|
void |
setFieldAttributeQuery(AttributeQuery fieldAttributeQuery)
Setter for this fields query |
void |
setFieldDirectInquiry(DirectInquiry fieldDirectInquiry)
Setter for the direct inquiry widget |
void |
setFieldInquiry(Inquiry fieldInquiry)
Setter for the inquiry widget |
void |
setFieldLookup(QuickFinder fieldLookup)
Setter for the lookup widget |
void |
setFieldSuggest(Suggest fieldSuggest)
Setter for the fields Suggest widget |
void |
setFormatter(Formatter formatter)
Setter for the field's formatter |
void |
setHiddenPropertyNames(List<String> hiddenPropertyNames)
Setter for the hidden property names |
void |
setInclusiveMax(String inclusiveMax)
|
void |
setInformationalDisplayPropertyNames(List<String> informationalDisplayPropertyNames)
Setter for the list of informational property names |
void |
setMaxLength(Integer maxLength)
Setter for attributes max length |
void |
setMinLength(Integer minLength)
|
void |
setMustOccurConstraints(List<MustOccurConstraint> mustOccurConstraints)
|
void |
setOptionsFinder(KeyValuesFinder optionsFinder)
Setter for the field's KeyValuesFinder instance |
void |
setOptionsFinderClass(Class<? extends KeyValuesFinder> optionsFinderClass)
Setter that takes in the class name for the options finder and creates a new instance to use as the finder for the attribute field |
void |
setPerformUppercase(boolean performUppercase)
Setter for this fields performUppercase flag |
void |
setPropertyName(String propertyName)
Setter for the component's property name |
void |
setRequired(Boolean required)
Setter for the required indicator |
void |
setSimpleConstraint(SimpleConstraint simpleConstraint)
When a simple constraint is set on this object ALL simple validation constraints set directly will be overridden - recommended to use this or the other gets/sets for defining simple constraints, not both |
void |
setSummary(String summary)
Setter for the summary message |
void |
setSummaryMessageField(MessageField summaryField)
Sets the summary message field. |
protected void |
setupFieldQuery()
Performs setup of the field attribute query and informational display properties. |
void |
setValidCharactersConstraint(ValidCharactersConstraint validCharactersConstraint)
|
Methods inherited from class org.kuali.rice.krad.uif.field.FieldBase |
---|
getComponentTypeName, getLabel, getLabelField, getLabelPlacement, getShortLabel, isLabelFieldRendered, setLabel, setLabelField, setLabelFieldRendered, setLabelPlacement, setShortLabel, setShowLabel |
Methods inherited from class org.kuali.rice.krad.uif.component.ConfigurableBase |
---|
getPropertyExpression, getPropertyExpressions, setPropertyExpressions |
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.Configurable |
---|
getPropertyExpression, getPropertyExpressions, setPropertyExpressions |
Field Detail |
---|
protected String alternateDisplayPropertyName
protected String additionalDisplayPropertyName
Constructor Detail |
---|
public AttributeField()
Method Detail |
---|
public void performInitialization(View view)
performInitialization
in interface Component
performInitialization
in class FieldBase
view
- - view instance in which the component belongsComponentBase.performInitialization(org.kuali.rice.krad.uif.view.View)
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 setupFieldQuery()
protected 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(AttributeDefinition attributeDefinition)
AttributeField
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.
attributeDefinition
- - AttributeDefinition instance the property values should be
copied frompublic List<Component> getNestedComponents()
Component
Used by ViewHelperService
for the various lifecycle
callbacks
getNestedComponents
in interface Component
getNestedComponents
in class FieldBase
ComponentBase.getNestedComponents()
public String getPropertyName()
DataBinding
getPropertyName
in interface DataBinding
DataBinding.getPropertyName()
public void setPropertyName(String propertyName)
propertyName
- 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 set)
public void setDefaultValue(String defaultValue)
defaultValue
- public Class<? extends ValueFinder> getDefaultValueFinderClass()
public void setDefaultValueFinderClass(Class<? extends ValueFinder> defaultValueFinderClass)
defaultValueFinderClass
- public Formatter getFormatter()
Formatter
instance that should be used when displaying and
accepting the field's value in the user interface
Formatters can provide conversion between datatypes in addition to special string formatting such as currency display
org.kuali.rice.krad.web.format.Formatter
public void setFormatter(Formatter formatter)
formatter
- public BindingInfo getBindingInfo()
DataBinding
BindingInfo
instance that is configured for the
component
getBindingInfo
in interface DataBinding
DataBinding.getBindingInfo()
public void setBindingInfo(BindingInfo bindingInfo)
bindingInfo
- public Control getControl()
Control
instance that should be used to input data for the
field
When the field is editable, the control will be rendered so the user can input a value(s). Controls typically are part of a Form and render standard HTML control elements such as text input, select, and checkbox
public void setControl(Control control)
control
- public String getErrorMessagePlacement()
public void setErrorMessagePlacement(String errorMessagePlacement)
public ErrorsField getErrorsField()
ErrorsField
holds configuration on associated messages along
with information on rendering the messages in the user interface
public void setErrorsField(ErrorsField errorsField)
errorsField
- 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 KeyValuesFinder getOptionsFinder()
KeyValluesFinder
that should be invoked to
provide a List of values the field can have. Generally used to provide
the options for a multi-value control or to validate the submitted field
value
public void setOptionsFinder(KeyValuesFinder optionsFinder)
optionsFinder
- public void setOptionsFinderClass(Class<? extends KeyValuesFinder> optionsFinderClass)
optionsFinderClass
- public String getSummary()
public void setSummary(String summary)
summary
- public String getDescription()
public void setDescription(String description)
description
- public AttributeSecurity getAttributeSecurity()
public void setAttributeSecurity(AttributeSecurity attributeSecurity)
attributeSecurity
- public boolean getSupportsOnLoad()
ScriptEventSupport
getSupportsOnLoad
in interface ScriptEventSupport
getSupportsOnLoad
in class ComponentBase
ComponentBase.getSupportsOnLoad()
public QuickFinder getFieldLookup()
The quickfinder widget places a small icon next to the field that allows
the user to bring up a search screen for finding valid field values. The
Widget
instance can be configured to point to a certain
LookupView
, or the framework will attempt to associate the
field with a lookup based on its metadata (in particular its
relationships in the model)
public void setFieldLookup(QuickFinder fieldLookup)
fieldLookup
- public Inquiry getFieldInquiry()
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 setFieldInquiry(Inquiry fieldInquiry)
fieldInquiry
- public Suggest getFieldSuggest()
If enabled (by render flag), as the user inputs data into the fields control a dynamic query is performed to provide the user suggestions on values which they can then select
Note the Suggest widget is only valid when using a standard TextControl
public void setFieldSuggest(Suggest fieldSuggest)
fieldSuggest
- public MessageField getSummaryMessageField()
public void setSummaryMessageField(MessageField summaryField)
summary
- field to setsetSummary
public String getConstraint()
public void setConstraint(String constraint)
constraint
- for this fieldpublic void setConstraintMessageField(MessageField constraintMessageField)
constraint
- field to setsetContraint
public MessageField getConstraintMessageField()
public ValidCharactersConstraint getValidCharactersConstraint()
public void setValidCharactersConstraint(ValidCharactersConstraint validCharactersConstraint)
validCharactersConstraint
- the validCharactersConstraint to setpublic CaseConstraint getCaseConstraint()
public void setCaseConstraint(CaseConstraint caseConstraint)
caseConstraint
- the caseConstraint to setpublic List<PrerequisiteConstraint> getDependencyConstraints()
public void setDependencyConstraints(List<PrerequisiteConstraint> dependencyConstraints)
dependencyConstraints
- the dependencyConstraints to setpublic List<MustOccurConstraint> getMustOccurConstraints()
public void setMustOccurConstraints(List<MustOccurConstraint> mustOccurConstraints)
mustOccurConstraints
- the mustOccurConstraints to setpublic SimpleConstraint getSimpleConstraint()
public void setSimpleConstraint(SimpleConstraint simpleConstraint)
simpleConstraint
- the simpleConstraint to setpublic Integer getMaxLength()
public void setMaxLength(Integer maxLength)
maxLength
- public Integer getMinLength()
public void setMinLength(Integer minLength)
minLength
- the minLength to setpublic Boolean getRequired()
Component
At the general component level required means there is some action the user needs to take within the component. For example, within a section it might mean the fields within the section should be completed. At a field level, it means the field should be completed. This provides the ability for the renderers to indicate the required action.
getRequired
in interface Component
getRequired
in class ComponentBase
ComponentBase.getRequired()
public void setRequired(Boolean required)
Component
setRequired
in interface Component
setRequired
in class ComponentBase
ComponentBase.setRequired(java.lang.Boolean)
public String getExclusiveMin()
public void setExclusiveMin(String exclusiveMin)
minValue
- the minValue to setpublic String getInclusiveMax()
public void setInclusiveMax(String inclusiveMax)
maxValue
- the maxValue to setpublic void setAdditionalDisplayPropertyName(String additionalDisplayPropertyName)
additionalDisplayPropertyName
- - Name of the additional display propertypublic String getAdditionalDisplayPropertyName()
public void setAlternateDisplayPropertyName(String alternateDisplayPropertyName)
alternateDisplayPropertyName
- - alternate display property namepublic String getAlternateDisplayPropertyName()
public String getAlternateDisplayValue()
public String getAdditionalDisplayValue()
public void setFieldDirectInquiry(DirectInquiry fieldDirectInquiry)
the
- DirectInquiry
field DirectInquiry to setpublic DirectInquiry getFieldDirectInquiry()
The direct inquiry widget will render a button for the field value when
that field is editable. It 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)
DirectInquiry
field DirectInquirypublic List<String> getInformationalDisplayPropertyNames()
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 setInformationalDisplayPropertyNames(List<String> informationalDisplayPropertyNames)
informationalDisplayPropertyNames
- public List<String> getHiddenPropertyNames()
public void setHiddenPropertyNames(List<String> hiddenPropertyNames)
hiddenPropertyNames
- public AttributeQuery getFieldAttributeQuery()
If field attribute query is not null, associated event script will be generated to trigger the
query from the UI. This will invoke the AttributeQueryService
to
execute the query and return an instance of AttributeQueryResult
that is then
read by the script to update the UI. Typically used to update informational property values or
other field values
public void setFieldAttributeQuery(AttributeQuery fieldAttributeQuery)
fieldAttributeQuery
- public void setEscapeHtmlInPropertyValue(boolean escapeHtmlInPropertyValue)
public boolean isEscapeHtmlInPropertyValue()
public boolean isPerformUppercase()
It this flag is set to true the 'text-transform' style on the field will be set to 'uppercase' which will automatically change any text input into the field to uppercase.
public void setPerformUppercase(boolean performUppercase)
performUppercase
- flag
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |