Skip to main content

ValueField Types (deprecated)

note

ValueFieldTypes are deprecated. See ValueTypes for the new alternative.

ValueFieldTypes define how to store and represent the values of a ValueField. The expanders already provide a number of built-in ValueFieldTypes and the validation base-component introduces a few additional ValueFieldTypes.

It is also possible to define your own ValueFieldType by adding it to a Component. You can then use the ValueFieldTypes in Fields in the Component itself or Components that depend on it.

A ValueFieldType has a number of properties:

  • name: The name, which is used to reference the type. It should be a valid java class-name.
  • fullType: Usually the same as the name, but is less restricted. It is expanded in some places as alternative identifier.
  • valueClass: A fully qualified java class name for the class that will represent values of this type.
  • customTransportClass: If set to false, a pojo class will be expanded with the name and package of the defined valueClass. If set to true, the class will not be expanded and will have to be provided in some other way.
  • displayType: How to represent the value. Can be one of the options described below
  • storageType: How to store the value. Can be one of the options described below
  • validator/converter: If defined, they will override the default expanded validator/converter

Display Types

NameDescription
stringShown as text, edited with basic input field
memoShown as html, edited with a rich text editor
multilineShown as multiple lines of text, edited with a text box
hyperlinkShown as a link, edited as input
fileShown as a download link, edited as file upload button
passwordShown as masked text, edited with password input field
booleanShown and edited as checkbox
integerShown as a number, edited in a number input field with only integers allowed
spinnerNot supported anymore
numberShown as a number, edited in a number input field with real numbers allowed
dateShown as a formatted date, edited with a calendar widget
dateLongShown as a formatted date + time, edited with a calendar and time widget

Storage Types

NameJava Class
integerjava.lang.Integer
doublejava.lang.Double
shortjava.lang.Short
longjava.lang.Long
booleanjava.lang.Boolean
bigdecimaljava.math.BigDecimal
datejava.util.Date
byte[]java.lang.byte[]
stringjava.lang.String

Component with only ValueFieldTypes

If a Component does not contain any DataElements or TaskElements, you may run into issues at runtime. This is because the Components are packaged as ejb modules, which require at least one bean class.

To remedy this, add an option to package the Component as a Jar module:

Option
maven.component.isJarModule Component

Packages the logic and data layers of this component as a jar module (without beans).

This can be used if the Component only exists to provide reusable classes. E.g. only defines ValueFieldTypes.

<options>
<maven.component.isJarModule/>
</options>

Compatibility

If a ValueField references a ValueFieldType, an equivalent ValueType will be provided to keep it compatible with the current expanders.

Likewise, for ValueFields with only a ValueType, an equivalent ValueFieldType will be defined, so that outdated expanders have the chance to be updated.