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

Access To Header and Footer Dynamically

Avatar

Level 3

Hello:

I need to be able to put a header and footer dynamically in the form at runtime.  For example: I have a button on my form, when the button is clicked it places certain text in the header and footer of the page.  This has to be done programmatically. thanks in advance....

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I will need to see the form to determine what is wrong ....can you send it to LiveCycle8@gmail.com with an explanation please?

Thanks

Paul

View solution in original post

8 Replies

Avatar

Level 10

Click on Master Pages and place the TextFields at top and bottom which will act like Header and Footer respectively..

You can assign values to these controls just like any other Field in the form, by passing the access path. (See the Highlighted section below).

Page1.Subform1.TextField1.rawValue ="Header Text";

Hope this gives an idea..

Thanks

Srini

Avatar

Level 3

Srini:

I sent you example file with some further detail...  I was unable to get your example to find the MasterPage fields.

Thanks

Avatar

Level 10

Billy,

     Here is the corrected form..I placed two buttons when you click them they will ask you to enter Header name and Footer name..

https://acrobat.com/#d=4HKLylqRPkaWdH5EOmW2-Q

     Please verify the code behind these buttons. I am assigning the Header and Footer by

          Form.MasterPage.Page1.TextField1.rawValue

          Form.MasterPage.Page1.TextField2.rawValue

     So in your actual form, you need to refer them the same way and pass the value from where you get it from in your code.

          For example: Form.MasterPage.Page1.TextField1.rawValue = TextField3.rawValue;

Thanks

Srini

Avatar

Level 3

I have a two page form, and one master page.  The text is working for the first page, but the second page does not have the text at the top or bottom even though it is using the same master page.  Any suggestion why the master page would not be the same for both pages?

Avatar

Former Community Member

Did you assign the Master page to the 2nd page? On the Page 2 object, click on the Pagination palette and on the Place field choose the Master Page you want in the On Page section.

Paul

Avatar

Level 3

Actually it is Page1 follow over to create a second page without a second page object.  So we only have a MasterPage object and Page1 object.

Avatar

Correct answer by
Former Community Member

I will need to see the form to determine what is wrong ....can you send it to LiveCycle8@gmail.com with an explanation please?

Thanks

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] ----