Hello Ross support,
I feel like i write too much on forum those days, sorry)
I found something strange: i have string choice constraint, with 3 values - so i see them as 3 buttons. now i want to change the values - ok, i create new array, and change it with another 3 values. Until now all good. So, now i want to replace it with new constraint that include 4 values instead of 3. And nothing happened. I tried also intChoice with same result. Now i believe its not about the constraint type - its about “toggle buttons” widget. Because in “list” widget its work as expected. So, i miss something, or this is an new release bug? Unfortunately, i dont have lower DB version right now, so i cant test it on prev. version DB.
Note i running Dashboard 9.02. I just prepared an example so you can see it by yourself:
asd
basda
hjk
cam1
cam2
cam3
var choices = new Array();
choices[0] = 'One';
choices[1] = 'Two';
choices[2] = 'three';
var newCon = params.createStringChoiceConstraint(choices);
params.replaceConstraint(“toggle”, newCon);
var choices = new Array();
choices[0] = '12';
choices[1] = '13';
choices[2] = '14';
var newCon = params.createStringChoiceConstraint(choices);
params.replaceConstraint(“toggle”, newCon);
var choices = new Array();
choices[0] = ‘One’;
choices[1] = ‘Two’;
choices[2] = ‘three’;
choices[3] = ‘four’;
var newCon = params.createStringChoiceConstraint(choices);
params.replaceConstraint(“toggle”, newCon);
var choices = new Array();
choices[0] = ‘12’;
choices[1] = ‘13’;
choices[2] = ‘14’;
choices[3] = ‘15’;
var newCon = params.createStringChoiceConstraint(choices);
params.replaceConstraint(“toggle”, newCon);
Hi Alex
When you change the number of controls needed to draw the parameter, DashBoard will always rebuild the container the parameter is in. If you put the parameter directly on the panel’s top-level container, you will see the issue you are describing (since the parameter itself is defined inside of that container and is getting destroyed/re-created).
The solution is to put the buttons inside of a container that can be rebuilt without taking-out your parameter. In this case, I’ve put your buttons inside of a with a single row to replicate the UI you had already drawn. When I change the number of choices, the will be silently rebuilt but the top-level and the parameter itself are unchanged.
asd
basda
hjk
cam1
cam2
cam3
var choices = new Array();
choices[0] = 'One';
choices[1] = 'Two';
choices[2] = 'three';
var newCon = params.createStringChoiceConstraint(choices);
params.replaceConstraint(“toggle”, newCon);
var choices = new Array();
choices[0] = '12';
choices[1] = '13';
choices[2] = '14';
var newCon = params.createStringChoiceConstraint(choices);
params.replaceConstraint(“toggle”, newCon);
var choices = new Array();
choices[0] = ‘One’;
choices[1] = ‘Two’;
choices[2] = ‘three’;
choices[3] = ‘four’;
var newCon = params.createStringChoiceConstraint(choices);
params.replaceConstraint(“toggle”, newCon);
var choices = new Array();
choices[0] = ‘12’;
choices[1] = ‘13’;
choices[2] = ‘14’;
choices[3] = ‘15’;
var newCon = params.createStringChoiceConstraint(choices);
params.replaceConstraint(“toggle”, newCon);
Cheers
James
#DashBoard