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

SIZE property

Checks the number of elements of a list input component

The input components

enable the creation of lists. The number of the list elements contained can usually be measured and evaluated using a rule. Using the SIZE attribute, for example, a rule can be defined which limits the number of possible entries in this input component to a certain value.

The expression <PROPERTY source='list' name='SIZE'/> can be used as the rule definition in the Value determination area (or for the definition of a precondition) and provides the number of entries that are currently contained in the input component.

In order to define a complete condition for a validation, a comparison value and an operator must be specified. Thus there are conditions such as these:

  • “Is the number of entries contained in the input component greater than 10?” or
  • “Is the number of entries contained in the input component less than 2?”

A comparison value such as these is required:

  • a constant, numeric comparison value (e.g. <NUMBER>10</NUMBER>) or
  • a variable comparison value, such as the number of entries in another input component of the indicated types

An operator is also required:

In this case, the expression will return a Boolean value.

Example 1) Limits the number of entries for a FS_CATALOG to 6 entries

The following form contains an input component st_downloadareas (for example, of type FS_CATALOG) for specifying references. A dynamic form is used to ensure that the editor does not add more than six entries to the list.

For this purpose, the number of entries in the input component is fetched within the <WITH/> section and compared against a numerical constant. The result of this less-than check is a Boolean value, which is then linked to a validation of the input component in the <DO/> section. As long as the condition (number of entries less than 6) is fulfilled, the Action NEW remains active.

    <RULE>
<WITH>
<LESS_THAN>
<PROPERTY name="SIZE" source="st_downloadareas"/>
<NUMBER>6</NUMBER>
</LESS_THAN>
</WITH>
<DO>
<PROPERTY name="NEW" source="st_downloadareas"/>
</DO>
</RULE>

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.12 | Data privacy