Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

this.resolveNode("Hyphen").presence="hidden" not respected in Render at Server

GPhillips58
Level 3
Level 3

We are trying to implement the OUTPUT module to generate pdf's after user fill them out.  I understand most of the differences between render at client and render at server.  What I am stuck on is the template has a text field "Hyphen" which displays a hyphen when there is a value for the 4 digit ZipPlus.  In designer when I run at Client the code works fine, when I run at Server (same as Output) it ignores "this.resolveNode("Hyphen").presence="hidden"".  I put an "xfa.log.message(1, "Hide Hyphen");" right after that line to verify the code is being hit and it is.  The code is on a fragment:

Page1.#subform[1].Addressee_Fragment_V1.AddresseeAddress::initialize

                if (this.resolveNode("Zip2").rawValue!=null)

                {

                 this.resolveNode("Zip2").presence="visible";

                 this.resolveNode("Hyphen").presence="visible";

                 xfa.log.message(1, "Show Hyphen");

                }

                else

                {

                 this.resolveNode("Zip2").presence="hidden";

                 this.resolveNode("Hyphen").presence="hidden";

                 xfa.log.message(1, "Hide Hyphen");

                }

Anyone have any ideas on how to make this work?

1 Accepted Solution
GPhillips58
Correct answer by
Level 3
Level 3

Well, this started working all of a sudden, both in Designer and through Output.  Maybe I just needed to close it and take a break.

View solution in original post

4 Replies
DarrenBiz
Level 7
Level 7

For the server, you might need to strictly scope your access to the fields Zip2 and Hyphen. There is a difference on how JS scopes its variables on the client and the server, mentioned here [1]. There is some more info on resolveNode scope here [2]

[1] Client/Server Scripting Differences

[2] resolveNode vs. resolveNodes

Mayank_Gandhi
Community Advisor
Community Advisor

Can you please share your sample form.?

-Mayank Gandhi

GPhillips58
Correct answer by
Level 3
Level 3

Well, this started working all of a sudden, both in Designer and through Output.  Maybe I just needed to close it and take a break.

View solution in original post

GPhillips58
Level 3
Level 3

I have been using the first link although application can get a little tricky.  The second I had not come across before but will definitely hang onto it as I had been wondering about that topic. Thank you.