Interface DataField

All Superinterfaces:
Cloneable, Component, Copyable, DataBinding, DictionaryBean, Field, Helpable, LifecycleElement, Ordered, org.springframework.core.Ordered, ScriptEventSupport, Serializable, UifDictionaryBean
All Known Subinterfaces:
InputField
All Known Implementing Classes:
DataFieldBase, InputFieldBase, LookupInputField

public interface DataField extends DataBinding, Helpable, Field
Component interface for data fields.
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Method Details

    • copyFromAttributeDefinition

      void copyFromAttributeDefinition(AttributeDefinition attributeDefinition)
      Defaults the properties of the 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.
      Parameters:
      attributeDefinition - AttributeDefinition instance the property values should be copied from
    • isInputAllowed

      boolean isInputAllowed()
      Indicates whether the data field instance allows input, subclasses should override and set to true if input is allowed
      Returns:
      true if input is allowed, false if read only
    • setPropertyName

      void setPropertyName(String propertyName)
      Setter for the component's property name
      Parameters:
      propertyName -
    • getPropertyEditor

      PropertyEditor getPropertyEditor()
      Performs formatting of the field value for display and then converting the value back to its expected type from a string

      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

      Returns:
      PropertyEditor property editor instance to use for this field
    • setPropertyEditor

      void setPropertyEditor(PropertyEditor propertyEditor)
      Setter for the custom property editor to use for the field
      Parameters:
      propertyEditor -
    • setPropertyEditorClass

      void setPropertyEditorClass(Class<? extends PropertyEditor> propertyEditorClass)
      Convenience setter for configuring a property editor by class
      Parameters:
      propertyEditorClass -
    • getName

      String getName()
      Returns the full binding path (the path used in the name attribute of the input). This differs from propertyName in that it uses BindingInfo to determine the path.
      Returns:
      full binding path name
    • getDictionaryAttributeName

      String getDictionaryAttributeName()
      Name of the attribute within the data dictionary the attribute field is associated with

      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

      Returns:
      attribute name
    • setDictionaryAttributeName

      void setDictionaryAttributeName(String dictionaryAttributeName)
      Setter for the dictionary attribute name
      Parameters:
      dictionaryAttributeName -
    • getDictionaryObjectEntry

      String getDictionaryObjectEntry()
      Object entry name in the data dictionary the associated attribute is apart of

      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

      Returns:
      String
    • setDictionaryObjectEntry

      void setDictionaryObjectEntry(String dictionaryObjectEntry)
      Setter for the dictionary object entry
      Parameters:
      dictionaryObjectEntry -
    • getDefaultValue

      Object getDefaultValue()
      Default value for the model property the field points to

      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.

      Returns:
      default value
    • setDefaultValue

      void setDefaultValue(Object defaultValue)
      Setter for the fields default value
      Parameters:
      defaultValue -
    • getDefaultValueFinderClass

      Class<? extends ValueFinder> getDefaultValueFinderClass()
      Gives Class that should be invoked to produce the default value for the field
      Returns:
      default value finder class
    • setDefaultValueFinderClass

      void setDefaultValueFinderClass(Class<? extends ValueFinder> defaultValueFinderClass)
      Setter for the default value finder class
      Parameters:
      defaultValueFinderClass -
    • getDefaultValues

      List<Object> getDefaultValues()
      Array of default values for the model property the field points to

      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)

      Returns:
      default value
    • setDefaultValues

      void setDefaultValues(List<Object> defaultValues)
      Setter for the fields default values
      Parameters:
      defaultValues -
    • getForcedValue

      String getForcedValue()
      For read only DataFields, if forcedValue has a value, the value of it will be used instead of the value received from the propertyName specified for this field; this can be combined with SpringEL to format a property value in some way, for example.
      Returns:
      the forced value
    • setForcedValue

      void setForcedValue(String forcedValue)
      See Also:
    • getHelpSummary

      String getHelpSummary()
      Summary help text for the field
      Returns:
      summary help text
    • setHelpSummary

      void setHelpSummary(String helpSummary)
      Setter for the summary help text
      Parameters:
      helpSummary -
    • getDataFieldSecurity

      DataFieldSecurity getDataFieldSecurity()
      Data Field Security object that indicates what authorization (permissions) exist for the field
      Returns:
      DataFieldSecurity instance
    • setComponentSecurity

      void setComponentSecurity(ComponentSecurity componentSecurity)
      Override to assert a DataFieldSecurity instance is set
      Specified by:
      setComponentSecurity in interface Component
      Parameters:
      componentSecurity - instance of DataFieldSecurity
    • isAddHiddenWhenReadOnly

      boolean isAddHiddenWhenReadOnly()
      Indicates the field should be read-only but also a hidden should be generated for the field

      Useful for when a value is just displayed but is needed by script

      Returns:
      true if field should be readOnly hidden, false if not
    • setAddHiddenWhenReadOnly

      void setAddHiddenWhenReadOnly(boolean addHiddenWhenReadOnly)
      Setter for the read-only hidden indicator
      Parameters:
      addHiddenWhenReadOnly -
    • getInquiry

      Inquiry getInquiry()
      Inquiry widget for the field

      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)

      Returns:
      Inquiry field inquiry
    • setInquiry

      void setInquiry(Inquiry inquiry)
      Setter for the inquiry widget
      Parameters:
      inquiry -
    • isEnableAutoInquiry

      boolean isEnableAutoInquiry()
      Indicates whether inquiries should be automatically set when a relationship for the field's property is found

      Note this only applies when the getInquiry() widget has not been configured (is null) and is set to true by default

      Returns:
      true if auto inquiries are enabled, false if not
    • setEnableAutoInquiry

      void setEnableAutoInquiry(boolean enableAutoInquiry)
      Setter for enabling automatic inquiries
      Parameters:
      enableAutoInquiry -
    • isRenderInfoMessageSpan

      boolean isRenderInfoMessageSpan()
      When true, render the info message span which contains can contain additional information about the field (used by Field Query functionality)
      Returns:
      true if the span will be rendered, false otherwise
    • setRenderInfoMessageSpan

      void setRenderInfoMessageSpan(boolean renderInfoMessageSpan)
      Parameters:
      renderInfoMessageSpan -
      See Also:
    • isRenderMarkerIconSpan

      boolean isRenderMarkerIconSpan()
      When true, render the marker icon span to show icons related to the field (used by CompareFieldCreateModifier on maintenance documetnts to mark editted fields)
      Returns:
      true if the the marker icon span will be rendered, false otherwise
    • setRenderMarkerIconSpan

      void setRenderMarkerIconSpan(boolean renderMarkerIconSpan)
      Parameters:
      renderMarkerIconSpan -
      See Also:
    • setReadOnlyDisplaySuffixPropertyName

      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
      Parameters:
      readOnlyDisplaySuffixPropertyName - name of the additional display property
    • getReadOnlyDisplaySuffixPropertyName

      String getReadOnlyDisplaySuffixPropertyName()
      Returns the additional display attribute name to be displayed when the field is readonly
      Returns:
      additional display attribute name
    • setReadOnlyDisplayReplacementPropertyName

      void setReadOnlyDisplayReplacementPropertyName(String readOnlyDisplayReplacementPropertyName)
      Sets the alternate display attribute name to be displayed when the field is readonly. This properties value will be displayed instead of actual fields value when the field is readonly.
      Parameters:
      readOnlyDisplayReplacementPropertyName - alternate display property name
    • getReadOnlyDisplayReplacementPropertyName

      String getReadOnlyDisplayReplacementPropertyName()
      Returns the alternate display attribute name to be displayed when the field is readonly.
      Returns:
      alternate Display Property Name
    • getReadOnlyDisplayReplacement

      String getReadOnlyDisplayReplacement()
      Returns the alternate display value
      Returns:
      the alternate display value set for this field
    • setReadOnlyDisplayReplacement

      void setReadOnlyDisplayReplacement(String value)
      Setter for the alternative display value
      Parameters:
      value -
    • getReadOnlyDisplaySuffix

      String getReadOnlyDisplaySuffix()
      Returns the additional display value.
      Returns:
      the additional display value set for this field
    • setReadOnlyDisplaySuffix

      void setReadOnlyDisplaySuffix(String value)
      Setter for the additional display value
      Parameters:
      value -
    • getReadOnlyListDisplayType

      String getReadOnlyListDisplayType()
      Gets the readOnlyListDisplayType.

      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:

      • "DELIMITED" - list will be output with delimiters between each item defined by readOnlyListDelimiter
      • "BREAK" - list will be output with breaks between each item
      • "OL" - list will be output in ordered list format (numbered)
      • "UL" - list will be output in unordered list format (bulleted)
      Returns:
      the display type to use
    • setReadOnlyListDisplayType

      void setReadOnlyListDisplayType(String readOnlyListDisplayType)
      Set the readOnlyListDisplayType
      Parameters:
      readOnlyListDisplayType -
    • getReadOnlyListDelimiter

      String getReadOnlyListDelimiter()
      The readOnlyListDelimiter is used to set the delimiter used when "DELIMITED" type is set for readOnlyListDisplayType
      Returns:
      the delimiter to use in readOnly list output with "DELIMITED" type set
    • setReadOnlyListDelimiter

      void setReadOnlyListDelimiter(String readOnlyListDelimiter)
      Set the readOnlyListDelimiter
      Parameters:
      readOnlyListDelimiter -
    • isApplyMask

      boolean isApplyMask()
      Indicates whether the value for the field should be masked (or partially masked) on display

      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 Component.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

      Returns:
      true if the field value should be masked, false if not
    • setApplyMask

      void setApplyMask(boolean applyMask)
      Setter for the apply value mask flag
      Parameters:
      applyMask -
    • getMaskFormatter

      MaskFormatter getMaskFormatter()
      MaskFormatter instance that will be used to mask the field value when isApplyMask() is true

      Note in cases where the mask is applied due to security (KIM permissions), the mask or partial mask formatter configured on Component.getComponentSecurity() will be used instead of this mask formatter

      Returns:
      MaskFormatter instance
    • setMaskFormatter

      void setMaskFormatter(MaskFormatter maskFormatter)
      Setter for the MaskFormatter instance to apply when the value is masked
      Parameters:
      maskFormatter -
    • getAdditionalHiddenPropertyNames

      List<String> getAdditionalHiddenPropertyNames()
      Allows specifying hidden property names without having to specify as a field in the group config (that might impact layout)
      Returns:
      hidden property names
    • setAdditionalHiddenPropertyNames

      void setAdditionalHiddenPropertyNames(List<String> additionalHiddenPropertyNames)
      Setter for the hidden property names
      Parameters:
      additionalHiddenPropertyNames -
    • getPropertyNamesForAdditionalDisplay

      List<String> getPropertyNamesForAdditionalDisplay()
      List of property names whose values should be displayed read-only under this field

      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.

      Returns:
      informational property names
    • setPropertyNamesForAdditionalDisplay

      void setPropertyNamesForAdditionalDisplay(List<String> propertyNamesForAdditionalDisplay)
      Setter for the list of informational property names
      Parameters:
      propertyNamesForAdditionalDisplay -
    • setEscapeHtmlInPropertyValue

      void setEscapeHtmlInPropertyValue(boolean escapeHtmlInPropertyValue)
      Sets HTML escaping for this property value. HTML escaping will be handled in alternate and additional fields also.
    • isEscapeHtmlInPropertyValue

      boolean isEscapeHtmlInPropertyValue()
      Returns true if HTML escape allowed for this field
      Returns:
      true if escaping allowed
    • isMultiLineReadOnlyDisplay

      boolean isMultiLineReadOnlyDisplay()
      Returns true if this field is of type TextAreaControl.

      Used to preserve text formatting in a textarea when the view is readOnly by enclosing the text in a </pre> tag.

      Returns:
      true if the field is of type TextAreaControl
    • setMultiLineReadOnlyDisplay

      void setMultiLineReadOnlyDisplay(boolean multiLineReadOnlyDisplay)
      Setter for multiLineReadOnlyDisplay
      Parameters:
      multiLineReadOnlyDisplay -
    • hasSecureValue

      boolean hasSecureValue()
      Indicates whether the value for the field is secure.

      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 a required KIM permission check failing.

      Returns:
      true if value is secure, false if not
    • isRenderFieldset

      boolean isRenderFieldset()
    • getSortAs

      String getSortAs()
      Sets the sort type if this field is used within a collection

      The default sort type is the Java class of the property being referenced. Since a String property may actually contain numeric or date values only this property can be used to better set the sort type.

      Returns:
      string representation of the sort type
    • setSortAs

      void setSortAs(String sortAs)
    • completeValidation

      void completeValidation(ValidationTrace tracer)
      Description copied from interface: Component
      Validates different requirements of component compiling a series of reports detailing information on errors found in the component. Used by the RiceDictionaryValidator.
      Specified by:
      completeValidation in interface Component
      Parameters:
      tracer - Record of component's location
      See Also: