Repeating Content¶
The RepeatingContent widget provides a flexible and user-friendly interface for managing a dynamic, vertically-oriented list of content sections. Each added section represents a row, containing a set of widgets for data entry and manipulation.
Key Features¶
- Offers a richer editing experience than the TableContent widget.
- Supports adding, deleting, and reordering rows.
- Provides separate preview, editor, and details panels for each row.
- Allows expanding and collapsing row content.
- Includes list import/export functionality.
Row Editors and Rules¶
Each row's preview, editor, and details panels can have associated rules for data validation and formatting. These rules are applied independently to each row.
Preview Panel¶
Displayed for each row; it can contain any widget suitable for displaying or performing basic edits on the row's data.
Editor Panel¶
Activated when the user interacts with an "Edit" button (or a similar control) within the preview panel. This panel typically contains widgets that allow for more detailed data editing.
Details Panel¶
This panel (controlled by the ExpandableDetails
property) is revealed when the user interacts with a "Details" button (or similar). It typically displays additional information related to the row's data.
Row Scripting¶
The RepeatingContent widget supports scripting to initialize new rows with default values or to perform calculations based on the data in other rows. This script is executed each time a new row is added. The newly added row is available via the $NewChild
variable within the script.
Example: Row Numbering Script¶
The following script automatically assigns a sequential row number to each new row added to the RepeatingContent widget:
1 |
|
This script assumes that rows are represented by elements with the path Rows/Row
in your data model. Adjust this path as needed to reflect your specific data model structure. The script uses the $Xml.Count()
function to determine the existing number of rows and assigns the next sequential number to the RowNumber
field of the new row.