Start page
Start page

Start page / Template development / Rules / Form properties <PROPERTY/> / Property DEFAULT

DEFAULT property

Checks whether an input component was preassigned a default value

The expression <PROPERTY source="gadget" name="DEFAULT"/> can use a precondition in the area Value determination of the rule definition (or for the definition of a precondition) and checks whether a (non-persistent) precondition was stored in the form. This property affects the precondition value, which is stored via preset=“default” in the form area. As soon as a value persists in the input component, for instance due to a manual takeover of the default values by the editor, the expression FALSE is returned.

Explanation on the attribute preset: With the attribute “preset”, it can be determined how default values are handled in an input component. If preset=“default” is set (default value), upon opening the form, the editor is shown the default value defined in the form. The displayed value is, however, not persistent (in contrast to the setting preset =“copy” ). With that, subsequent changes to this value in the form template automatically affect all uses of the input components based on it. These input components are highlighted with a separate color scheme (compare to Default values).

Examples

Example 1) Checking whether metadata were saved for a form

For the input component “meta_text” for maintaining metadata, the template developer stores a default value in the form properties. Upon opening the form, this default value is shown in the input component (here: “test”). As long as, for the input component “meta_text ”, the default value is not taken over by the editor or was not overwritten by the specification of a new value, a note for the editor should appear (“No metadata...”). The FirstSpirit Framework, in this case, returns for the expression <PROPERTY source="meta_text" name="DEFAULT"/> TRUE. So that the validation of a rule violation is shown and, with it, the warning text, the expression has to be negated within the value determination.

<RULES>
<ON_EVENT>
<WITH>
<NOT>
<PROPERTY source="meta_text" name="DEFAULT"/>
</NOT>
</WITH>
<DO>
<VALIDATION>
<PROPERTY source="meta_text" name="VALID"/>
<MESSAGE lang="*" text="No meta data set - accept pre-defined default value"/>
<MESSAGE lang="DE" text="Keine Metadaten gesetzt - Vorgabewert übernehmen"/>
</VALIDATION>
</DO>
</ON_EVENT>
</RULES>

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2013-12-09