Posts in Category "Tutorials"

Add, Recalculate

Here’s a little something that very important to know when working with dynamic subforms and using their “Instance Managers”:http://blogs.adobe.com/formbuilder/2006/05/instantiating_subforms_at_runt.html (IMs) to add instances of them to a form: New subform instances aren’t automatically incorporated into the form’s calculations!

You would immediately notice this problem if you had a form which calculated a total based on line items which can be added or removed from the form. When you add a new line item using the IM’s _addInstance(bool)_ method, the grand total of, say, the cost of all line items isn’t updated to reflect the data you enter into the new line item. This is because the new line item hasn’t been made part of the form’s set of calculation dependencies and is therefore not accounted for by your “grand total” calculation. As a matter of fact, until a call to xfa.form.recalculate() is made, none of the new instances added will be included in the form’s calculations.

To demonstrate this, I’ve created a sample form which has a “line item” section to which line items can be added. As line items are added and their costs changed, the grand total fields at the bottom calculate the total cost of the order: One grand total field performs its calculation using the FormCalc _SUM_ function and a SOM Expression identifying the collection of fields to total while the other uses the LineItem dynamic subform’s IM object to calculate the grand total. Finally, there’s a check box at the top of the repeating “line item” section which, when checked, will cause the “Add Item” button to execute the xfa.form.recalculate(true) statement after adding a new line item. To see the difference, play around with the form by adding line items with the check box both checked and unchecked.

“Download Sample [zip]“:http://blogs.adobe.com/formbuilder/samples/im/AddRecalculate.zip

*Minimum Requirements:* Designer 7.x, Acrobat 7.x.

Data-Nominated Subforms

I thought I would post a little sample on data-nominated subforms tonight. This is a new feature, introduced in Designer 7.1, which can be a very powerful tool.

Since the feature essentially lets you define expressions against values from data being loaded into a form in order to control which subform, from a specified set (subform set containing subforms), will be used for the record currently being loaded into the form, you can do very interesting things. For example, you might have a table which lists data. Maybe you would like to use a row which has a yellow background to identify data which is not important, one with an orange background for data that’s important and one with a red background for data that’s very important. This can be easily achieved using Data-Nominated Subforms.

I’ve created a little sample based on the movie data I used for the “Conditional Breaks Sample”:http://blogs.adobe.com/formbuilder/2006/05/conditional_breaks.html I posted a few days ago. In this sample, I have a subform set which contains 3 subforms, each capable of binding to a movie record. The twist is that I want to use the green subform for comedies, the red one for action movies and the blue one for dramas.

“Download Sample [zip]“:http://blogs.adobe.com/formbuilder/samples/DataNominatedSubforms.zip

*Minimum Requirements:* Designer 7.1, Acrobat Pro 7.0.5.

*Note:* A basic understanding of Data Binding is required for this sample.

Continue reading…

Conditional Breaks

Some of you have requested a sample of the new Conditional Breaks feature in Designer 7.1.

This feature allows you to set conditions, based on imported data, which determine when breaks should occur.

For example, you may have data that you want to list by category and every time the category changes, you’d like to start the new category on a new page. Or, you may have a separator that you want to insert in between sets of data on your form.

I’ve created a little sample which demonstrates the Conditional Breaks feature by listing some movie data where each time the category changes, a new page starts. Don’t forget to import the data.xml file into the form when you open it in Acrobat.

“Download Sample [zip]“:http://blogs.adobe.com/formbuilder/samples/ConditionalBreaks.zip

*Minimum Requirements:* Designer 7.1, Acrobat 7.0.5.

*Note:* A basic understanding of Data Binding is required for this sample.

Continue reading…

Samples! Give Me Samples!

One of the best places to look for Designer samples is on the “LiveCycle Designer Samples Site”:http://www.adobe.com/devnet/livecycle/designer_samples.html. There, you’ll find lots of samples demonstrating various Designer techniques and features.

Although new samples are constantly be posted to the Designer Samples Site, they can’t always cover all topics or address all of our customer’s questions/issues. As such, I’ll be posting some of my own samples to my blog. Look for them under the *Samples* category.