cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically Hiding a Master Page

Former Member
0 Kudos

Dear All,

I have two master pages.

Is it possible to hide the master pages dynamically?

If by FormCalc/javascript, kindly embed the code.

Regards,

Prosenjit.

Accepted Solutions (0)

Answers (3)

Answers (3)

sunil_mani
Active Participant
0 Kudos

You can hide the master page depending on any condition you have. But there is one clean rule. If your master page doesn't want to get printed then content area of that master page should not contain any data. It means even if you hide all the data in the content area, your whole master page ( including its instances i.e overflown pages) will be hidden.

For that you have to create a text field in your layout and drag and drop it in the content area of the master page which you want to hide. The text field acts like a flag whether or not to hide the master page. If 'X' then hide. Else do not hide. The value of the flag field will be decided while coding in the interface itself based on your condition. Then wrap the data of the content area including your flag field in a sub form. Do not forget to hide the flag field after wrapping it in the sub form because you don't want to show this on the page if that page is displayed by any chance.

Finally click on the whole wrapped sub form. Write below Form calc script in events Initialization, Form Ready and Layout Ready.

Here the HIDEPAGE_FLAG is nothing but your flag field.

if ( $.HIDEPAGE_FLAG == "X" ) then

$.presence = "hidden"

endif

This code hides your whole sub form . It means there will be no data shown in the content area and the Adobe framework doesn't print that specific master page(and all its instances). 🙂


Former Member
0 Kudos

Hi Sunil,

I am facing the similar error, a blank page appears even though the sub form and its data is hidden.

I followed your steps, even then its giving me the same blank page.

Do you have any idea as to why this might occur ?

Regards,

Chaitanya

Former Member
0 Kudos

in form:ready write xfa.form.<node>.<page>.presence = "hidden".

put this code in Page1 if you want to hide the second page.

Former Member
0 Kudos

Hi,

We are facing the same issue as yours. We need to hide a master page based on a condition. Could you please clarify your answer. Is that JAVA scripting? What do you mean by a <node> ? If you know code for Form Calc please let us know. Your response will be very helpful.

Thank you.

Karthik

Former Member
0 Kudos

Hi Prosenjit,

You can acheive this without FormCalc/JavaScript Coding.

Create a Master page and do not add any elements from the Library on that page. Click on the body page in which to hide the master page. In the Object pallette, Navigate to Pagination tab. There, for the first field, "Place" Select the content area of the master page you just created. So, this master page gets assigned to your body page, and because it has no elements it would give a feel of hiding the master page.

Regards,

Runal