Expand my Community achievements bar.

Master Pages - Can I add a page before my master page?

Avatar

Level 2

I have a form that is showing my final page as a master page.  I have an add button on the page before that adds a group of information when you click it.  As I understand it, the master page guards the positioning of that page.  My issue is that I now need to make that group of information larger and it requires a second page, but the master page will not allow for the page insertion.  I know I must have a master page and though I would really like to keep the final page static, I would be willing to change the first page from a normal page to a master page but I can't seem to find how to that either. I need to add a page in between.  Any suggestions?

27 Replies

Avatar

Level 10

Well,

master pages are designed to give form a basic layout (logos, pages size etc.), just like a backgound image of a desktop.

Everything else in the form (fields, buttons, tables etc.) should be placed one one or more body page(s).

You will need to setup your form in that way, that everything dynamic (show/hide subforms etc.) happens on the body pages.

Avatar

Level 2

Ok. I understand, but then why am I not able to insert a page above the master page?

Avatar

Level 10

XFA-Forms have a tree structure, you can imagine such as layers.

Root (layer 0) > Master Pages (layer 1) > Body Pages (layer 2) > Subforms/Form Objects (layer 2, 3, 4...).

Master Pages are always located a layer deeper than Body Pages so you cannot add a Body Page between or in front of them.

Avatar

Level 2

So is there a way to make my master page the first page instead of the last page so that I can add pages to the form?

Avatar

Level 2

Here is my document. The master page is the last page. I need to add a page before it in order to extend the information on the previous page.

Avatar

Level 10

Sorry, the link seems to be missing

Avatar

Level 2

Hm. Not sure why - but here it is again.

Avatar

Level 10

Just in relation to sharing your form: you cannot attach your form to a posting, neither by responding directly on the forum nor by attaching the form to an email response.

The best way is to upload your form to a file sharing site, like Acrobat.com and then share the published link here.

Niall

Avatar

Level 2

Thank you for the information. The link in Acrobat.com is https://acrobat.com/#d=rP19-DlvIcAWoy*u6xwFhQ.

Avatar

Level 2

Thank you. My forum ran cold. Since the issue was not being able to move the master page, I recreated the whole form and the master page was not in the way. However, now the add buttons are not working. The link is below, can you tell me where I went wrong with the "add" buttons? Thank you for your help! Arla

https://acrobat.com/#d=QWKdpP2HupzJv-MPpaJOFA

Avatar

Level 10

Hi,

I'll jump in...

There are a few problems with the form:

  • It was saved as a static form, which does not allow dynamic behaviour like adding rows. I have saved it as a Dynamic XML Form in the save as dialog.
  • In order for a form with repeatable objects to work, generally the page should be set up as Flowed. Currently it is positioned, which means that the objects on the page are positioned with x and y coordinates. I changing the untitled page, to "page2" and then before I set it to Flowed, I wrapped static objects in a positioned subform. Otherwise the layout would be shot.
  • Not naming objects (including pages) makes it difficult to script against. Name as you go!
  • The subform that you want to repeat "Customerinfo" needs to be set to repeat in the Object > Binding palette.
  • In the script you did not specify the name of the repeating subform that you want to add new instances. I have added this, see line 16 in your original form. Also there were errors in the object references. Effectively you had repeat script above the auto-generated script, so I deleted the auto-generated script.

I have the "Add more ships to" button working, see if you can get the others going.

Here is the form back to you: https://acrobat.com/#d=Eh*hknpY8vgVHAQSTIpMsw

There is a bit of adjustment in the layout after changing the page to Flowed.

Paul Guerette is giving a free online Tech Talk on dynamic forms and I would recommend it. Details are here: Tech Talk: Developing Flowable Form Content

Hope that helps,

Niall

Avatar

Level 2

Great! Thanks! I will let you know how it works out for me. I really appreciate your help!

Avatar

Level 10

I found a few error.

1. Your script in the "AddSubformButton1" references to "form1._Customerinfor" which is a typing error. Correct it to "form1._Customerinfo"

2. The Subform "fCustomerinfo" is not repeatable because the surrounding subform is set to positioned.

It has to be a flowing subform to allow several instances of the included subforms.

3. Your script in the button references to a variable "oSubform" that picks up the value of the variable "sSubformSOM" but this one does not contain a usable SOM expression to the desired subform!

var sSubformSOM = "<value>";    

It should look something like

var sSubformSOM = "xfa.form.form1.subform1";    

Avatar

Level 2

Ok. So I tried in Preview to make the ship to button work and it says that I have reached the maximum number of entries allowed. I know that a minimum and maximum need to be set for each subform that are repeatable, but I'm not sure where to find that.

Avatar

Level 10

Hi Arla,

If you select the repeating object, in this case the ship to subform. Then go to the Object > Binding palette:

Parallels Desktop1.png

You don't have to set a min count, max count or initial count for this to work. The form I posted previously just has a min count specified.

The message you are getting is in the if statement in your script.

Niall

Avatar

Level 10

It's because of the second point I mentioned before.

Your form design is not flowing so the subforms cannot be repeatable.

Start with the subform that sourround the subforms to repeat.

Make it flowing (Object palette > Subform tab).

Then select the subforms and make them repeatable (Object palette > binding tab).

Avatar

Level 2

I see your screen print, but the min is grayed out in the design view. Please see below.

Avatar

Level 2

Sorry, Radzmar. I cannot make sense of what you are telling me.

Avatar

Level 10

The secont Page in your form hierachy (unnamed) is the sourrounding subform for the subform "Customerinfo".

To get "Customerinfo" repeatable, the page has to be set to be flowing first (Object palette > Subform tab).