Avatar

Correct answer by
Level 10

Hi,

This is the script I use. Note that you have to specify the UI reference for the object type:

var vName = this.somExpression;

var fieldObj = xfa.resolveNode(vName + ".ui.#choiceList.border.fill.color");

fieldObj.value = "255,255,255"; // white


/* Check the type of object and change the .ui reference:

     Date field =      #dateTimeEdit 

     Dropdown =      #choiceList 

     Checkbox =      #checkButton 

     Text field =      #textEdit 

     Numeric field =     #numericEdit

*/

Also the object has to have a background colour to start with.
Hope that helps,
Niall

View solution in original post