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

Preserve Header & Footer in Text Field that flows across a page

Avatar

Level 1

Hi,

I'm trying to create a form, where the main text field flows onto the next page (which I have go it to do). I have created two master pages, the first page and the continuation page. I want the main text field to expand onto the continuation page, while preserving the footer of the main page and the header/footer of the continuation pages. On the continuation page I have a name field on the top of the page, I want this to be the value of the same text box from the main page, how do I achieve this.

The layout must remain how it 'looks' on the two master pages, I just want text to be written in the main area on the first page to continue into the main area of the second page. I want the second page to replicate as many times as it needs to fit the text in.

HELP! PLEASE!!

I have attached my work so far, please feel free to pick it to shreds and make it work!!!

Gareth

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

For the 1st problem you can simply set the binding of that field to global and all fields will have the same value. Click on the object and the in the Object palette their is a Binding tab. In the default binding drop down change it from None to Global.

For the 2nd problem you have a field on Pg1 that is called numberOfPages. This field is used in conjuction with another field on the Master Page2. It shodul not be on this page. I removed it then I was able to resize the titleForm subform to fit the space.

Paul

View solution in original post

3 Replies

Avatar

Level 4

Hi Gareth,

Here is one thing I would try:

First, one master page (since both master pages are the same anyway)

Second: make the Content Area start just below where the header ends, and end just above where the footer starts. Since objects, like text fields, are restricted to content areas, they will not run over the footer or the header when your form automatically continues onto a second page.

Third: set the (untitled subform)(page1) to "flowed". Then it will just grow to accommodate the text field however long it gets.

This method works with my forms, all of which have consistant headers and footers on the master pages; however, I ususally am working with tables, not flowed text fields.

Best regards,

Jenny

Avatar

Level 1

Firstly, Thanks for your help, I have got my head around the whole thing now.  I only now have 2 problems, where one is relatively minor and the other is aesthetic.  The first problem is in regards to the master pages. I have created two master pages, the first, which contains the standard header/footer for the first page and the second the contains the standard header footer for the second page and onwards. I have controlled the reoccurrence of the first page so when the main text field spills out it spills onto the second master page.  On page 1, there is the main form, within this form there are 2 sub forms, one of which is:  titleForm - which contains all the standard stuff that's required for the first page and a load of dynamic fields. It includes a field called "statementOf' which is where the person would write their name. This sub-form sits within the flowing form and has a "positioned" property, to keep the layout etc.  The next subform within the main form contains the main text for the form. This subform is set to flow and the contents are set to break across pages.  The form works exactly how I wanted it to, apart from.....  Page2 (master page) has a page number area and an area that shows should show the value of the "statementOf" field from the subform "titleForm" which is contained within the main form page. This is a text field object that I have also called "statementOf". I have tried adding some java into the initialise function for the field that is located on master page 2, however, the code I inseted did not pull the value from the main form across when the new page was created. The Code I wrote was:  this.rawValue == form1.PG1.titleForm.statementOf.rawValue;  This didn't work!  I have tried a load of other bits and bobs and the persons name just won't show up in the field contained on the second page. HELP!  The second problem is in relation to the size of the titleForm sub form. It has assumed a height when I created it, which I cannot reduce, so it "eats away" on the space set aside for the main text. The border of the subform is about 2cm away from the nearest object, so I can't work out why it's not snugging up to the last object. HELP  I have attached the amended form....

Avatar

Correct answer by
Former Community Member

For the 1st problem you can simply set the binding of that field to global and all fields will have the same value. Click on the object and the in the Object palette their is a Binding tab. In the default binding drop down change it from None to Global.

For the 2nd problem you have a field on Pg1 that is called numberOfPages. This field is used in conjuction with another field on the Master Page2. It shodul not be on this page. I removed it then I was able to resize the titleForm subform to fit the space.

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----