Checkbox Tree

A hierarchical list control with multiple selectable values.

Start value: Multiple comma(,)-separated values controls which leaf nodes that are initially selected.
Return value: Multiple comma(,)-separated values of selected leaf nodes.
Supported in: NewEdit Parameter page Multirow

Appearance

Recommendations

It is not recommended to use the control in multirow since it will give a bad user experience.

It is not recommended to have more than a few hundred items in the list, since it will lead to bad user experience and slow performance. Use multi-picker instead which allows the user to see all selected nodes and fetch only the expanded nodes.

Interactions

The user may select multiple nodes at once by shift-clicking the checkboxes.

The user may navigate within the control using the arrow keys, and space for selection.

SQL

SQL Call: Get checkbox tree (mandatory)

May modify database: No

Resultset: Tree nodes

Table count: repeated exactly once
Row count: zero or more rows
Columns
Id mandatory string
Value of the node in the tree.
Label mandatory string
Displayed text of node in the tree.
ParentId optional string
Column that refers to the id column of the parent node. This column is used to place a node under another.
StartExpanded optional bit
Indicates whether a parent node should start expanded.
Default: Defaults to not expanded.

Default value

SQL Call: Default value

Retrieves the default value for the control.

May modify database: No

Resultset: Default value

Table count: repeated exactly once
Row count: exactly one row
Columns
<column with ordinal 1> mandatory string
The default value

Validation

SQL Call: Validation

This call is only made if there is a field validation set for the field info and the field has any content.

Live Validation

Performs field validation when the user leaves the field or one of its dependencies is changed, initial values set by default value and initial values in edit-mode are not validated.

Save Validation

When saving the validation runs server side if the field value has changed. A field value is considered changed if in new mode the value is anything other than NULL. In edit mode it is considered changed if it has a value that was not returned by the GetEditFields procedure.

May modify database: No

Parameters

@Value string
The value of the field, the procedure will not be called if value is NULL.

Resultset: Validation messages (optional)

Table count: repeated zero or one time
Row count: zero or one row
Columns
Error optional string
Error message to display. Blocks the user from saving.
Info optional string
Informative message to display. Does not block saving.
Warning optional string
Warning message to display. Does not block saving.

Examples

Checkbox tree

CREATE PROCEDURE Example.Item_CheckboxTree
AS
BEGIN
	SELECT
		CONCAT('C', C.CategoryId) AS Id,
		C.CategoryName AS Label,
		CONVERT(varchar(30), NULL) AS ParentId
	FROM
		Example.Category C
	UNION ALL
	SELECT
		CONCAT('I', I.ItemId) AS Id,
		I.ItemName AS Label,
		CONCAT('C', I.CategoryId) AS ParentId
	FROM
		Example.Item I
	ORDER BY
		Label;
END;