These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

livecycle form dynamically add pages?

firstdecimal
Registered: May 28 2010
Posts: 22

hi.. i am working on a livecycle form that is basically a custom invoice form. i was using it and it was pretty good until i recently needed more line than where available on the sheet. i can easily create an additional page, but i was wondering if there is a more dynamic way of handling that so don't have to use two sheets unless i need them.

there are subtotal, shipping, taxes and total fields some of which are automatically calculated. so here is how i envision that could work, please correct me if im crazy or there is a much better way. user gets to end of form but needs more lines, pushes button that creates another page, subtotal, shipping, taxes and total get moved to the end of the table of the new page. is this possible? thank you for your help..

My Product Information:
LiveCycle Designer, Windows
Niall
Expert
Registered: Apr 26 2006
Posts: 62
Hi,

LC Designer comes with a number of templates and sample files. Check out this sample:

C:\Program Files\Adobe\Adobe LiveCycle Designer ES2\EN\Samples\Forms\Purchase Order\Dynamic Interactive\Forms\Purchase Order.pdf

it includes a button to add additional rows to the table (and a button in each row to delete that row).

To implement this you need to make sure you have a few settings right:
(1) the form must be saved as Dynamic (see the drop down in the Save As dialog).
(2) the page must be setup as a Flowed subform. You can have Positioned subforms inside this for the header and footer.

Check out the FormCalc script in the calculate event of the total, which will sum all of the rows.

Hope that helps,

Niall

Hope this helps,

Niall
Assure Dynamics

firstdecimal
Registered: May 28 2010
Posts: 22
wow ok that is pretty close to what i need. thank you. i am afraid its beyond my programming skills though. i have gotten the form pretty far on my own making it calculate and display $ but i dont understand how i am supposed to plug in the script and tie it in with my fields and so on.
Niall
Expert
Registered: Apr 26 2006
Posts: 62
Hi,

I would break it into steps concentrating on one aspect at a time. Once you get it running once it will become easier.

The add row button uses a function called the instanceManager to add an instance. The script in the click event of the Add Item button is:

details._detail.addInstance(1);

"details" is the name of the table.

"_" the underscore is shorthand for instanceManager.

"detail" is the name of the row that is set to repeat in the Object > Binding tab. If you select the detail row and look at the Binding tab you will see that it is checked to repeat the row for each data item and the initial count is three. This is why when you look at the form at design time there is one row, but in Preview there are three rows."addInstance(1)" says that you want to add another instance of the repeatable object (detail) on each click. The "1" is true.

Maybe try getting the add button to work and then move on to the other parts of the form.

The help file has information and samples if you search for instanceManager or addInstance.

Niall

Hope this helps,

Niall
Assure Dynamics

firstdecimal
Registered: May 28 2010
Posts: 22
oh my.. sorry i have not checked back here. thank you for your response. i will research the instance manager details you mentioned. the script looks simple. i am pretty sure i do not have a table named "details" so i guess i have to figure out how to designate the fields i want to replicate as part of the details table. it certainly explains why the script was not working when i grabbed it form the sample form. i often get ahead of myself and in the process neglect to learn rudimanetary things such as the description and explanation of the script itself. thank you :-)
firstdecimal
Registered: May 28 2010
Posts: 22
ok.. redid the document using master page with logo and some other basics time / date, page numbers etc. in the body content area laid out the info etc wrapped everything in sub forms, do i have to use the insert table function so i can call it out later to replicate or can i use names fields i have placed? i would prefer the latter since it looks nicer and gives me more flexibility. thank you for your help.
Niall
Expert
Registered: Apr 26 2006
Posts: 62
Hi,

If I understand you correctly, you are setting up a table.

Yes, it is easy to make a row of the table repeatable and then have a button to add rows. You can also repeat the entire table using the instanceManager.

Sometimes it is easier to have a 'table' appearance, setting out objects in rows and columns using subforms. Again you can use instanceManager on subforms to create multiple instances.

Really it is up to you to decide what you will pass through to the instanceManager - a page reference, a subform reference or a table/row reference.

I hope that helps,

Niall

Hope this helps,

Niall
Assure Dynamics

firstdecimal
Registered: May 28 2010
Posts: 22
yes. i was able to wrap all of the fields into a subform i called datarow. i also wrapped the header (description of the fields on the "table") into a seperate subform so i can call it out to repeat when it jumps to a new page. the form itself is called RFQform so that changes my request from details._detail.addinstance(1) to RFQform._datarow.addinstance (1) correct? after trying to make it work though, the add and remove button still dont work :-) all the calculations are fully functional but im still wrestling with the code to make it add and subtract an instance of datarow.