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.
Filtered LinkField dropdowns
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>