Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
devel:documentation:application_configuration:dev:dynamic-forms [2019/09/25 07:27] tomiskar |
devel:documentation:application_configuration:dev:dynamic-forms [2021/02/10 18:20] (current) tomiskar [Dynamic forms (eav)] |
| |
<note> | <note> |
**''FormService'' service for working with the extended attributes on the back-end.** **''FormInstance''** utility is useful on BE - contains value transformation to maps by attributes etc.. | **''FormService'' service for working with the extended attributes on the back-end.** **''FormInstance''** utility is useful on BE - contains value transformation to maps by attributes etc.. Use this service in your custom module, benefits: |
| * single autowired service for work with definitions, attributes and values |
| * cache ''core:form-definition-cache'' for loading form definitions (with attributes) is effective here. |
</note> | </note> |
<note> | <note> |
| |
<note important>Saving form values for the form definition work as **PATCH**. When attribute value has to be deleted, then form value with **null** has to be given (use it even for multi valued attributes).</note> | <note important>Saving form values for the form definition work as **PATCH**. When attribute value has to be deleted, then form value with **null** has to be given (use it even for multi valued attributes).</note> |
| |
| <note>If single attribute is saved (''FormService#saveAttribute''), then event ''EAV\_SAVE'' is not published. Save all attributes (''FormService#saveValues''), if publishing event ''EAV_SAVE'' for owner is needed.</note> |
| |
Dynamic form attribute supports data types (''persistentType''): | Dynamic form attribute supports data types (''persistentType''): |
| |
All [[https://github.com/bcvsolutions/CzechIdMng/tree/develop/Realization/frontend/czechidm-core#component-descriptor|component descriptor]] features are supported. Read tutorial, [[tutorial:dev:how_to_create_eav_face_type|how to create custom form attribute renderer]]. | All [[https://github.com/bcvsolutions/CzechIdMng/tree/develop/Realization/frontend/czechidm-core#component-descriptor|component descriptor]] features are supported. Read tutorial, [[tutorial:dev:how_to_create_eav_face_type|how to create custom form attribute renderer]]. |
| |
| Custom configuration can be added to registered renderers (@since CzechIdM 10.8.0) - use ''AbstractFormAttributeRenderer'' on backend to define additional renderer properties. |
| |
===== Adding the support of extended attributes for a new entity ===== | ===== Adding the support of extended attributes for a new entity ===== |
<note info>Min and max validation is supported for numeric ''DOUBLE'', ''INT'', ''LONG'' persistent types.</note> | <note info>Min and max validation is supported for numeric ''DOUBLE'', ''INT'', ''LONG'' persistent types.</note> |
| |
==== Regex ==== | === Regex === |
| |
Value has to match given regular expression ([[https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html|java pattern]] is used). | Value has to match given regular expression ([[https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html|java pattern]] is used). |
{{ :devel:documentation:application_configuration:dev:validation.png |}} | {{ :devel:documentation:application_configuration:dev:validation.png |}} |
| |
==== Validation message ==== | === Validation message === |
| |
Custom validation message. If message is not defined, then default message by invalid validation type will be shown. | Custom validation message. If message is not defined, then default message by invalid validation type will be shown. |