Hi Everardo,
If I have understood what you’re trying to achieve, this can be done by using the “hidden” property which value (true, false) will depend on the setting of your radio button list (that should be linked to a hierarchy for getting its values). Your radio button list has to be set to avoid multiple choices.
something like this set on the Change Value event of your radio button list should do the job:
var adapters = this.parentView.control.adapters;
var tableForCountAdapter = null;
var tableForAmountAdapter = null;
for (var index = 0; index < adapters.length; index++)
{
// always check that you’re not pointing to a null value, just in case…
if (adapter)
{
var adapter = adapters[index];
var adapterName = adapter.name;
if (adapterName === “theScriptNameOfYourTableForCount”)
{
tableForCountAdapter = adapter;
}
if (adapterName === “theScriptNameOfYourTableForAmount”)
{
tableForAmountAdapter = adapter;
}
}
vpRadioButtons = this.parentView.control.getViewParameterByName(“theScriptNameOfYourRadioButtonList”);
var radioButtonArray = vpRadioButtons.parameterValue.values;
// just to be sure that there is a value set…
if (radioButtonArray === null || radioButtonArray.length <= 0)
{
// no choice has been set
// And the Lord says “thou should always set a default value!”
tableForAmountAdapter.hidden = true;
tableForAmountAdapter.hidden = true;
}
else
{
// a value is set
var radioButtonUniqueName = radioButtonArray.first().uniqueName;
//here I assume that your hierarchy is set on the Id, in order to be sure
// just set “debugger;” at this level in order to check the uniqueName structure returned
// and then replace the “.A.Id” by the value corresponding to your hierarchy
var radioButtonId = Number(radioButtonUniqueName.replace(".A.Id",""));
// let’s say that the Id 1 corresponds to the first value of your filter (I assume that it’s “Count”)
// and Id 2 corresponds to the “Amount” choice
if (radioButtonId === 1)
{
tableForAmountAdapter.hidden = true;
tableForACountAdapter.hidden = false;
}
if (radioButtonId === 2)
{
tableForAmountAdapter.hidden = false;
tableForCountAdapter.hidden = true;
}
}
I hope this helps,
Olivier