void OnGetUserSelectionItems(IListSource ioList, string inTag, IListSourceItem inCurrSelection, UserSelectionOptions ioParams)
Description
This callback is used to customize a prompt dialog window during the interview. This callback function is called once calling the function "OpenUserSelection" (Click Here to learn about this function).
Parameters
The following is a list of parameters the functions receives
Parameter | Type | Description |
---|---|---|
ioList | string | List of options |
inTag | IListSource | Name of the tag |
inCurrSelection | IListSourceItem | Question index |
ioParams | UserSelectionOptions | The parameters to set |
Return Type
void
Example
"OpenUserSelection("myOnCancelPrompt")" will call the "OnGetUserSelectionItems" callback function with "myOnCancelPrompt" as the "inTag" parameter.
The following callback function implementation will do the following - If the current selection in the "myOnCancelPrompt" dialog is empty, create a prompt with user selection with two answers, "Yes" and "No", and the title will be "Are you sure you want to cancel?". If the selection is not empty, if it is "2" ("No"), the interview will be cancelled:
function OnGetUserSelectionItems(ioList, inTag, inCurrSelection, ioParams)
{
if (inTag == "myOnCancelPrompt") {
// build the window text and buttons
if (inCurrSelection == null) {
ioList.Add("Yes", 1);
ioList.Add("No", 2);
ioParams.Title = "Are you sure you want to cancel?";
}
// do actions based on selected answer
else {
if(inCurrSelection.Value==1)
{
ExecutionMgr.CancelSubject();
}
}
}
}
Comments
Please sign in to leave a comment.