Skip to main content

Initializing values

This section describes options that provide a default value for FieldsFieldA property of a DataElement expanded to a database column and user interface input element..

These options will handle both data persistence and user interface behavior regarding default values.

Option
defaultValue Field

Provides a default value for a ValueField that has a boolean, numeric or string type. The value is assigned as default in the data layerLayerLogical separation of functionality within a single system/application, focused on code organization. and also as the initial value in forms in the Knockout UI.

caution

In case of a string, the value must be surrounded with quotes.

Examples
  • Boolean: defaultValue: true. Sets true as the initial value for a Boolean fieldFieldA property of a DataElement expanded to a database column and user interface input element..
  • Number: defaultValue: 5. Sets 5 as the initial value for a number (Integer, Long, Double...) fieldFieldA property of a DataElement expanded to a database column and user interface input element..
  • String: defaultValue: 'new name'. Sets new name as initial value for a String fieldFieldA property of a DataElement expanded to a database column and user interface input element..
<options>
<defaultValue>'New Value'</defaultValue>
</options>
Option
generateUuid Field

Causes a new UUID to be generated and stored in this fieldFieldA property of a DataElement expanded to a database column and user interface input element. whenever a new instance is created. Use value "if_empty" to generate a UUID only if no value was passed to the create method in the details object.

<options>
<generateUuid/>
</options>
<options>
<generateUuid>if_empty</generateUuid>
</options>
Option
isNullable Field

FieldFieldA property of a DataElement expanded to a database column and user interface input element. is initialized as null. Useful for Dates.

<options>
<isNullable/>
</options>