Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
devel:documentation:application_configuration:dev:dynamic-forms [2019/07/25 12:41]
tomiskar
devel:documentation:application_configuration:dev:dynamic-forms [2019/09/25 07:29]
tomiskar
Line 92: Line 92:
 {{tag>validation}} {{tag>validation}}
  
 +For form attribute values is possible to configure prepared validations. Validation are evaluated (**on the backend**), when form with extended attributes is saved and sent to backend. Simple validations as ''required'', ''min'', ''max'' are evaluated on frontend after value is changed.
  
-==== Regex ====+<note important>Validations are suported for single attribute values only for now (feature request [[https://redmine.czechidm.com/issues/1874|#1874]]).</note> 
 + 
 +=== Required ==
 + 
 +Value is required. 
 + 
 +=== Unique === 
 + 
 +Value has to be unique. 
 + 
 +<note info>Unique validation is not supported for ''BYTEARRAY'' and ''ATTACHMENT'' persistent types.</note> 
 + 
 +=== Min, Max === 
 + 
 +Value has to be greater than (lesser than) or equal given ''min'' (''max'') values. Real number (38,4) can be configured. 
 + 
 +<note info>Min and max validation is supported for numeric ''DOUBLE'', ''INT'', ''LONG'' persistent types.</note> 
 + 
 +=== 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).
Line 106: Line 125:
 </note> </note>
  
 +{{ :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.
  
 <note tip>Can contain localization key (e.g. ''core:validationError.invalid.unique''). Parameters ''min'', ''max'', ''regex'', ''unique'', ''required'' is available for localization message.</note> <note tip>Can contain localization key (e.g. ''core:validationError.invalid.unique''). Parameters ''min'', ''max'', ''regex'', ''unique'', ''required'' is available for localization message.</note>
 +
  
  
Line 135: Line 156:
   * Attachment renderer: support multiple files, validation support (now is validation on input)   * Attachment renderer: support multiple files, validation support (now is validation on input)
   * Created deep copy, when form values are copied => attachment is linked to two form values and is removed, when the first one is deleted.   * Created deep copy, when form values are copied => attachment is linked to two form values and is removed, when the first one is deleted.
 +  * [[https://redmine.czechidm.com/issues/1874|#1874]]: Support unique validation for multivalued eav attributes
  • by tomiskar