Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

First instance in a subform to repeat on each page

ParreLaws
Level 4
Level 4

I have a repeating subform with a list of names.

list.JPG

I would like the first name in this subform to appear on every page.

    top of page 1

top of page.JPG

Is their a script I can place in a field on the master page to make this happen? If not is there a way to make this happen?

Thank you for any assistance.

Parre

5 Replies
Anonymous
Not applicable

Hi ParreLaws,

I believe there is no need of scripting.

Since you always wanted the first intance to repeat on every page, why don't you create a  subform in the Master Page? This subform should have a table with one row which can be binded to the first instance of the repeating section in the XML.

In this case, your hierarchy would be something like this:

<form.>

     <MasterPages>

          <Page1>

               <ContentArea>

               <Table>

Please let me know if i am not clear.

Thanks,

ParreLaws
Level 4
Level 4

Hi alcdtrainer,

Thank you for your assistance, but can you please tell me how to bind it only to the first row? When I go under Object, Binding and use global binding and the other "name fields" in my table are the same.

Thanks again for your assistance.

Parre

Anonymous
Not applicable

Hi ParreLaws,

Considering that your XML looks something like this:

<main>

     <main1>

          <page1>

               <repeat>

                         <firstName>

                         <lastName>

                         <middleName>

               <repeat>              

                         <firstName> 

                         <lastName>

                         <middleName>

               <repeat>              

                         <firstName> 

                         <lastName>

                         <middleName>         

                 

You can add the following scirpt at the ffield level (for firsName):

this.rawValue = xfa.resolveNode("$record.main1.page1.repeat.firstName").value;

Note: 1) $record always refer to the parent node (here it is main). So, it is not requied to mention the top most parent name main in the path.

         2) Since the index is not mentioned, the above script will always take the first repeating intance values

Keep the binding as Global

     

Please let me know if there is any issue.

Thanks,

ParreLaws
Level 4
Level 4

Hi Alcdtrainer,

I'm not very advanced in this software and I'm having a difficult time understanding the process. Where can I find the XML that shows  the tree that you outlined?  Also, where should I place the script? When I keep the binding as Global it make all the names the same.

Thanks again

Parre

Anonymous
Not applicable

Hi Parre,

1) The input data to PDF/XDP is an XML. Any XML is always represented in a parent child (tree) hierarchy. The XML that i had shared in the above post is just a sample one.

2) The script can be added in the initialize event of a field.

Suggest you to go through the basics of scripting,  a PDF that is avaialble at following path:

http://help.adobe.com/en_US/livecycle/8.2/LiveCycle_Designer_Scripting_Basics.pdf

If you are still facing an issue, pls mail me your template and XML at alcdtrainer@gmail.com

Thanks