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

DESELECT property

Manipulates the selection behavior of CHECKBOX and LIST

You can use the DESELECT property to manipulate the selection behavior in option-based input component types, i.e.:

DESELECT can be used to deactivate selected entries. The entries can be compared with the value of the following input component types:

The (source) input component (“gadget1” in the sample code below) whose value is to be removed from CMS_INPUT_CHECKBOX or CMS_INPUT_LIST is specified as follows in the value determination area within the rule definition:

<WITH>
<PROPERTY name="VALUE" source="gadget1"/>
</WITH>

The (target) input component (“gadget2” in the sample code below) from which an entry is to be removed is specified as follows in the handling instruction area of the rule definition using the DESELECT attribute:

<DO>
<PROPERTY name="DESELECT" source="gadget2"/>
</DO>

The only values supported are those that have been defined for the input component via the “values” parameter in the <ENTRIES/> tag (e.g., in the case of CMS_INPUT_CHECKBOX).
If an attempt is made to remove a value that is not part of the value set, a warning is displayed on the Java Console:

Invalid value 'e' for property 'DESELECT'.

For further manipulation options, see also the SELECT property.

Examples

Example: Removing entries from a list by entering a value in a text component

Regeln Eigenschaft DESELECT

The simple example below illustrates how a value can be entered in a text component (“st_text”) for the purpose of selecting corresponding values in a CMS_INPUT_CHECKBOX input component (“st_list”). Within this context, the ENTRY tag is used in CMS_INPUT_CHECKBOX to define the values a, b, c, and d. In the example, all four values are initially activated/selected.

<RULE>
<WITH>
<PROPERTY name="VALUE" source="st_text"/>
</WITH>
<DO>
<PROPERTY name="DESELECT" source="st_list"/>
</DO>
</RULE>

Entering a in the text component deactivates a in the list. Entering b in the text component deactivates b in the list.

If the value entered in the text component is not part of the value set for the CMS_INPUT_CHECKBOX component (e.g., m), a corresponding warning is output on the Java Console.

Alternatively, the list component can also be populated dynamically with values from a database table (using CMS_INCLUDE_OPTIONS).

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