Scroll

Action Event: Sequentially enable prompting parameters

This action event disables all parameters except the first on the initial load of the prompt screen. A parameter becomes enabled once the previous one in the list has been given a value. This could be used to enforce dependencies for parameter options.

Note: In this example, the client-side javascript is in separate file to improve readability.

Global Event Type: OnChangeParameterValue

This event occurs whenever the value of a parameter is changed in the prompt screen.

References:

  • WebReportsApi.dll

Namespaces:

  • WebReports.Api

Code

string actionString = File.ReadAllText(@"{filepath}\actionString.js");
sessionInfo.JavascriptAction.SetJsCode(actionString);
return sessionInfo.JavascriptAction;

actionString.js

var parameterList = clientInfo.parameterListCtrl.ParameterList;
var selectedIndex = clientInfo.parameterListCtrl.SelectedIndex;
var disableIndex = selectedIndex + 2; // disable everything beyond the next parameter

for (var i = 0; i < parameterList.length; i++)
{
  if (i < disableIndex)
    parameterList[i].SetEnabled(true);
  else
    parameterList[i].SetEnabled(false);
}

Hidden Article Information

Article Author
Exago Development
created 2016-03-31 19:33:46 UTC
updated 2017-06-19 20:25:37 UTC

Labels
parameters, dependencies, SAE, action event, events, example, dependency, one by one, prompt,
Have more questions? Submit a request