The dynamic display of parameters is controlled through the hasDependentParameters and isParameterRequired functions.
Function | Description |
---|---|
public boolean hasDependentParameters(String key) | Return true if the display of other parameters is dependent on the parameter with this UniqueKey value. If the value of a function is changed, and that function has dependent parameters, the isParameterRequired method will be run. This function is run for every user input parameter in the analytic function. |
public boolean isParameterRequired(String key) | Return true if the parameter with this UniqueKey should be displayed. This function is run for every user input parameter in the analytic function. |
Example
In the example below, the parameter with UniqueKey “MULTIPLIER” will only be displayed when the radio switch parameter “INCLUDE_MULTIPLIER” is set to true.
public boolean hasDependentParameters(String key) { if ("INCLUDE_MULTIPLIER".equals(key)) { return true; }else{ return false; } } public boolean isParameterRequired(String key){ Boolean included = (Boolean) getParameterValue("INCLUDE_MULTIPLIER"); if (!included && "MULTIPLIER".equals(key)){ return false; }else{ return true; } }