Expand my Community achievements bar.

Renaming Form Bindings?

Avatar

Level 2

Hi Everyone,

This issue is giving me a big headache and I am not even certain it is possible. Anyhow, a client of mine has designed a form in Acrobat Pro, to which he uses that form to present the information from a program that he had designed. I am have been asked to recreate the form. I am using Lifecycle to create the form with all the elements of the original form. When I finished the PDF, I noticed that the bindings were all named differently. If I create a form field in Acrobat Pro and call it "Property", it will appear in the PDF as "Property", and will display the info from the application. However, in Lifecycle, the naming achitecture is different. I created a text field and called it "Property" in the binding area. When I save the document, I find out that it is now called "form1[0].#subform[0].Property[0]" which screws up everything. How do I tell Lifecycle to leave it as it is .... "Property".

Any help would be great


11 Replies

Avatar

Level 10

LiveCycle uses a Heirarchy for all the fields in the form.

When you see "form1[0].#subform[0].Property[0]" that means Property field is grouped under subform which is grouped under form1. The [0] means first occurence of the field. Using LC you can dynamically create fields at the runtime which will increase the index value from 0, 1, 2 etc..

If you want to refer to (or) access Property field properties /methods you can use the name directly in your code or use the full path..

Property.rawValue;

(OR)

form1[0].#subform[0].Property[0].rawValue;

Hope this helps..

Thanks

Srini

Avatar

Level 2

Hi Srini,

I forgot to mention that the code in the application can not be changed. So in other words, I need to fix it on my end. His program code is much to complex he said to change.

Any way I can stop the naming hierarchy?

Matt

Avatar

Level 10

Matt,

     When you say his code where it resides? Did you import his form in your LC Designer and adding additional fields?

     In LC you have two supported languages JavaScrip and FormCalc.

     Some of the properties and methods supported in Acrobat may not be supported in LiveCycle scripting.

    

     To refer to the Property feld:

     JavaScript:

          Property.rawValue

     FormCalc:

          Property.rawValue

          (OR)

          Property

     Will this give an idea? If possible you can post your form to LiveCycle9@gmail.com so I can have a look at it.. While sending, please mention the problem..

    

Thanks

Srini

Avatar

Level 2

Hey S,

The process basically goes that within his program, resides about 50 different PDFs (all of which I need to fix). Based on the type of project he is doing, the program will associate that project with a PDF. The program has its own GUI. When he is done, he clicks save and the data that was typed into the program gets sent to the PDF file, which looks for the binding fields ( e.g. property) and places the value into the PDF. This is why the PDF file must have the proper binding name. I hope this clarifies the process.

MAtt

Avatar

Level 10

Matt,

     The PDF will accept input as an XML file. So in the GUI , when the user clicks on the save button, I assume it will generate an XML file based on the data and send it to PDF for rendering.

     In this case, you need to have the XML file in your LC designer and create a data connection with it. Then you need to map fields on your form to a tag in the XML. That way, when the user send data to PDF, it knows where to put the particular XML tag value.

In the Below example, I am binding the ProjectName tag to a text field on the form. So in the run time if I pass an XML with data to this form, the ProjectName value will be displayed in the text field.

Hope this helps.

DataBinding.jpg

Thanks

Srini

Avatar

Level 2

Hey S,

Actually I think he is connecting the two together through Microsoft SQL. How will this impact, or how do I set it up for SQL ?

MAtt

Avatar

Level 10

Matt,

     You can add a DataConnection to connect to SQL Server Database. Use OLEDB instead of XML as data connection.

     Then you can bind each field on your form to the database field (as shown in the image in above post).

Thanks

Srini

Avatar

Level 2

Hey Srini,

Great, it all worked perfectly. Thanks so much for the help.

One last question, is it possible to make the PDF text automatically continue to to the next page? So, if I were to write a lot of content and filled up the first page, the sentence/paragraph would continue automatically to the next page? Like Microsoft Word

Matt

Avatar

Level 10

Matt,

     There is a check box in the Object palette for Subform/ Table/ Row called "Allow Page Breaks with in the Content".. You need to check this if you want to wrap the text to the next page if it overflows.

Thanks

Srini

Avatar

Level 2

Awesome, I'll have to give that a try. Thanks again

Matt

Avatar

Level 10

Another thing to note is your Subform/ Page should be set to Flowed instead of Positioned in the Object palette to make the wrapping work..

Thanks

Srini