Hiding an Object on the Master Page | Community
Skip to main content
November 3, 2006

Hiding an Object on the Master Page

  • November 3, 2006
  • 7 replies
  • 10322 views
I'm searching for an answer to a problem: how do you hide an object that's located on the master page of a form??



I have a text field on the master page of my form that displays a predefined string value. I would like to hide this text object (or remove the value) when the form is printed but have the object and/or text re-displayed afterwards. I've tried the following solutions with no success:



- Setting the presence of the object to invisible in the prePrint event and setting the presence back to visible using the postPrint.



- Setting the font color to white in the prePrint event and setting the font color back to black using the postPrint.



- Setting the value of the object to an empty string in the prePrint event and setting the value back to the predefined string value using the postPrint event.



- Setting the relevant property of the object to "-print" in the XML source of the form.



My LiveCycle and javascript knowledge is fairly limited so I'm not sure if I'm approaching this in the wrong way. Any help would be much appreciated...
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

7 replies

November 6, 2006
Have you tried changing the presence of the field? You can run a search for "Changing the presence of a form design object" in your Designer Help, there are scripting samples in there to help you. The only catch is that you have to save the form as a dynamic form in order to change the presence of an object. You should be able to make the object invisible in the click event of your print button.
November 7, 2006
David,



I've tried changing the presence of the field with no success. Changing the presence to invisible worked fine when the object was located on a body page but when I moved the object to the form's master page, the script no longer worked. BTW, I'm running the script from the field object's prePrint and postPrint events and not from a button click event.



I'm still scratching my head over this one...
November 7, 2006
Make sure you're saving your PDF as a dynamic PDF and not a static PDF.



Chris

Adobe Enterprise Developer Support
November 8, 2006
Chris,



The form has already been saved as a dynamic PDF since there are repeating subforms in its design. Maybe I'm referencing the object incorrectly. Right now the field on the master page is using



>this.presence = "invisible";



and



>this.presence = "visible";



in the corresponding prePrint and postPrint events...
November 8, 2006
The script looks fine. Here's a quick sample that does this. Maybe it will help you figure out what's different between this and yours.



Chris

Adobe Enteprise Developer Support
November 9, 2006
OK now I'm even more confused...I've done exactly the same thing as you did in the sample form but to no avail. So on a whim, I cut and pasted the text field from the sample into my form and lo and behold, it worked! I have no clue why but I'm just glad it did. I hope I don't run into this problem in the future...could it be some sort of glitch?
Level 4
July 20, 2009

What was the trick to this?  I'm having the same issue....I want to hide my subform using the prePrint and postPrint event on the master page and it's not working, but it works on the body page.  My form is dynamic and my script is this.presence = "hidden";

Thanks

Level 4
August 28, 2009
hi, I need this solution too

my email

alecam@email.it

thank's
Raghu_Nagireddy
Level 6
September 11, 2009

Hello,

Please try this and fins the attached sample for the same.

write the script in TOP level of the form.

---form1::prePrint - (JavaScript, both)----

form1.Page1.TextField1.presence = "hidden";

form1::postPrint - (JavaScript, both)

form1.Page1.TextField1.presence = "visible";

save as dynamic pdf.

Thanks,

Raghu.