Expand my Community achievements bar.

SOLVED

Controlling Printing of Drop Down Box

Avatar

Level 3

I have a drop down box with a default value of empty/none.

If the user has not changed the value from the default, I would like the drop down box excluded from the print out.

Also, as you can see, the box is initially highlighted with a light shade of gray, unless the user changes the value.

However, the gray shading covers the entirety of the box, including the caption.

Is it possible to exclude the caption from the shading?

Lastly, I'm wondering if it's possible to restrict the shading, such that it does not cover beyond the drop-down arrow in the horizontal direction.

In the actual form, the drop-down boxes will be directly adjacent, and I would prefer that the highlighting not overlap to the adjacent box.

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The prePrint and postPrint are the right way to go, I just changed "" to null. Also you could apply the shading in the object / field tab, custom appearance.

The enter event access the ui of the object and changes the shading to white:

var vName = this.somExpression; // gets the full SOM expression for the object...
var fieldObj = xfa.resolveNode(vName);

var fld = fieldObj.ui.resolveNode("#choiceList"); // see ui codes below
fld.border.fill.color.value = "255,255,255";


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

    Date field =     #dateTimeEdit 
    Dropdown =         #choiceList 
    Checkbox =         #checkButton 
    Text field =     #textEdit 
    Numeric field =    #numericEdit

*/

A similar script on exit changes it back to light grey. You may want to alter the RGB values.

Lastly I don't think you need the initialise or change scripts.

Good luck,

N.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Hi,

The prePrint and postPrint are the right way to go, I just changed "" to null. Also you could apply the shading in the object / field tab, custom appearance.

The enter event access the ui of the object and changes the shading to white:

var vName = this.somExpression; // gets the full SOM expression for the object...
var fieldObj = xfa.resolveNode(vName);

var fld = fieldObj.ui.resolveNode("#choiceList"); // see ui codes below
fld.border.fill.color.value = "255,255,255";


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

    Date field =     #dateTimeEdit 
    Dropdown =         #choiceList 
    Checkbox =         #checkButton 
    Text field =     #textEdit 
    Numeric field =    #numericEdit

*/

A similar script on exit changes it back to light grey. You may want to alter the RGB values.

Lastly I don't think you need the initialise or change scripts.

Good luck,

N.