OnGetUserSelectionItems()

bool OnGetUserSelectionItems(ioList, inTag, inCurrSelection, 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 IListSource List of options 
inTag string Name of the tag 
inCurrSelection Int Question index 
ioParams UserSelectionOptions  The parameters to set

 

Return Type

bool

 

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();
}
}
}
}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.