Select and Deselect
Select
The Deluge Select task is used in on load form action script and on user input field action script to show the specified item(s) in a single select or multi select picklist field, as selected.
The Deluge Selectall task is used in on load form action script and on user input field action script to show all items in a multi select picklist as selected.
Syntax
//to select a specific item(s)
field.select(<value>);
//to show all items as selected
field.selectall();
where,
<field> refers to a single select / multi select picklist field in case of the Select task and only multi select picklist field in case of Select all task.
<value> refers to any user specified value or a Deluge expression that evaluates to a value.
DeSelect
The Deluge DeSelect task is used in on load form action script and on user input field action script to deselect the specified item(s) in a single select or multi select picklist field.
The Deluge DeSelectall task is used in on load form action script and on user input field action script to show all items in a multi select picklist as deselected.
Syntax
//to deselect a specific item(s)
field.deselect(<value>);
//to deselect all items
field.deselectall();
where,
<field> refers to a single select / multi select picklist field in case of the DeSelect task and only multi select picklist field in case of DeSelect all task.
<value> refers to any user specified value or a Deluge expression that evaluates to a value.
Example
The following example demonstrates how to preselect the checkbox options based on value selected in a list field:
Assume that “Options” is your picklist field and “Equipment” is your checkbox field.You need to add the following script to the Field Actions>On User Input action of the "Options" picklist
if (input.Options == "Tennis")
{
Equipment.deselectall();
Equipment.select("Racquet");
}
else if(input.Options == "Football")
{
Equipment.deselectall();
Equipment.select("Ball");
}
Note:
- deselect(<value>) and select(<value>) task can be used for both single select (Radio and dropdown) and multiple select (checkbox and multiselect) fields.
- selectAll() and deselectAll() task can be used only for multiple select(checkbox and multiselect) fields.
