Skip to main content

DataElement Forms

Each DataElement has a form to create or edit instances.

Disabling or Hiding Fields

Fields can be disabled or hidden in the forms by adding options to the model.

Option
cruds.form.hide Field

Hide this field in all forms

<options>
<cruds.form.hide/>
</options>
Option
cruds.form.hideOnCreate Field

Hide this field on the create form

<options>
<cruds.form.hideOnCreate/>
</options>
Option
cruds.form.hideOnModify Field

Hide this field on the edit form

<options>
<cruds.form.hideOnModify/>
</options>
Option
cruds.form.disable Field

Disable this field in all forms

<options>
<cruds.form.disable/>
</options>
Option
cruds.form.disableOnCreate Field

Disable this field on the create form

<options>
<cruds.form.disableOnCreate/>
</options>
Option
cruds.form.disableOnModify Field

Disable this field on the edit form

<options>
<cruds.form.disableOnModify/>
</options>

Filtered LinkField dropdowns

Option
isLinkDriver Field

Filters the options of another LinkField based on the value selected in this field.

E.g. say we have a Customer and an Address DataElement, where a customer has multiple addresses. If we select a Customer in a form, we want to only be abe to select Addresses linked to that Customer.

The value of the option should correspond to linkTarget: "$targetField$", finder: "$finderForTargetElement$", finderField: "$fieldToUseInFinder$".

  • linkTarget is the name of the field that should be filtered.
  • finder is the finder that should be used to find the filtered options.
  • finderField is the field in the finder that contains a reference to the current field.
note

The option has another, outdated, way to define the value:

{linkDriverField}_{targetField}.{finderField}_{finder}

Here linkDriverField should be the name of the Field with the isLinkDriver option.

<options>
<isLinkDriver>linkTarget: "address", finder: "findByCustomerEq", finderField: "customer"</isLinkDriver>
</options>
<options>
<isLinkDriver>costumer_address_findByCustomerEq</isLinkDriver>
</options>
<options>
<isLinkDriver>customer_address.customerField_findByCustomerEq</isLinkDriver>
</options>