Tag List¶
The TagList widget allows users to select multiple options (tags) from a predefined list. This list can be populated statically or dynamically using data sources (see Data Sources for details). The user can remove tags from the list by clicking on the close icon on the tag.
Manual Entry¶
If the AllowNew
property is set to true
, users can enter values not present in the predefined list. Otherwise, only existing options can be selected.
Data Model¶
The TagList widget uses a sequence-type data model to store selected items. Each selected item results in a new element within the data model, containing the selected item's value.
Data Mapping¶
-
Value Assignment:
- Defined by the data source item's
Value
property using theValueXPath
property. - Default: Empty string, assigning the data source item value to the new element.
- Defined by the data source item's
-
Label Assignment:
- Defined by the data source item's
Text
property using theCaptionXPath
property. - Default: Empty string, assigning the data source item's
Text
property to the new element'sCaption
attribute.
- Defined by the data source item's
State Attribute¶
The TagList widget supports monitoring list item changes using the State attribute:
Temp
: Marks newly checked items.- Existing Items: Preserved as is.
Deleted
: Marks items that were unchecked.
Clearing the State Attribute:
Use the scripting method $Xml.CommitDeletes() to reset the State
attribute.
Data Source Caching¶
For improved performance, the widget caches data sources by default. This caching can be disabled by setting the CacheDataSources
property to false
. Disabling caching causes data sources to be reloaded each time the widget is rendered.
Example¶
Considering the following data model:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|