Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Field shows on form, only content prints out

Avatar

Level 7

How do I get the field to display on the form, but the box or field background shading doesn't print--only the user filled in content prints out.

Thanks,

MDawn50

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You would need to have script in the prePrint and postPrint events of each field that has a background fill colour. You could also set up a loop to look through all of the object and change the background colour, but that is a bit more complicated. Try this first.

prePrint:

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

fieldObj.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

*/

postPrint:

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

fieldObj.value = "225,255,225"; // the original RGB of the object

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

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

*/

You will need to change the .ui reference depending on the object type. For example the script above is for a textField.

Good luck,

Niall

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Hi,

You would need to have script in the prePrint and postPrint events of each field that has a background fill colour. You could also set up a loop to look through all of the object and change the background colour, but that is a bit more complicated. Try this first.

prePrint:

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

fieldObj.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

*/

postPrint:

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

fieldObj.value = "225,255,225"; // the original RGB of the object

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

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

*/

You will need to change the .ui reference depending on the object type. For example the script above is for a textField.

Good luck,

Niall

Avatar

Level 7

Thanks for your quick response. I'll give this a try.

Margaret

Avatar

Level 7

It worked perfectly.

Thank you.

Margaret Dawn

Supervisor - Documentation

W: 630-850-1065