buttonSetIcon for all fields with same name
I am trying to change the icon for all the fields with the same name, then apply a different icon to the event.target.
I have written the following code. The target gets the icon correctly, but the rest of the fields' icons are not changed, and I'm not sure why.
var icon = this.getField("LabelIcon").buttonGetIcon()
var NoIcon = this.getField("LabelNoIcon").buttonGetIcon()
var oAll = this.getField("DangerCheck");
var aAll = oAll.getArray();
for(var field of aAll)
{
field.buttonSetIcon(NoIcon);//This doesn't work.
}
event.target.buttonSetIcon(icon); //This line works fine.
Any idea what might cause this?
