Archive for September, 2006

Selecting Specific Database Records

Every now and then, someone posts a comment with a question on how to do something and the answer requires more than just a quick response. In this case, it was “Ricardo’s question”: on how to select a specific record from a data connection to a database for editing in a form.

If you read my previous post on “Connecting a Form to a Database”:, you might’ve realized that the result was a single live data connection to the entire set of records in a database. This is great if you want to iterate through all records one at a time and update them on an individual basis. You might’ve also realized that you could narrow the scope of the data connection by specifying a more specific SQL statement (with a _WHERE_ clause, for example). But what if you wanted the form to filter, on the spot, the data loaded from the data connection? For example, you might want to let the user pick from the different movie categories (action, comedy or drama) and then let them iterate through only that subset of the Movie Database.

If you’ve been scratching your elbow, pinching your nose and blinking your eyes in hopes that this might “just work”, well, it’s actually scratch your nose, pinch your elbow and roll your eyes — ok, just kidding…

Continue reading…

Getting a List’s New Selection

Have you ever struggled to figure-out what item from a list (list box or drop down list) a user had just selected in the list’s Change event? If so, it’s possible you were trying to use the

bc. rawValue

property in order to get at this information.

Unlike other objects such as exclusion groups, the _rawValue_ property of a list object doesn’t reflect the new selection until the selected value is committed to it (by the user tabbing or clicking away from the list). That means that if you’re trying to, say, make a certain field visible at the moment when a particular item in the list is selected, you can’t use the _rawValue_ property because it still contains the _old_ (previous selection) value.

Instead, you must use the

bc. xfa.event.newText

object/property of the Change event itself and possibly the list object’s

bc. boundItem

function in order to determine the _value_ associated with the new selection.

Continue reading…

Designer Training at MAX

“Mike Potter”: will be giving a “training session”: on LiveCycle Designer at “Adobe MAX 2006″: next month.

As he prepares for his session, I’d like to give you an opportunity to influence what he’ll talk about so that his session is as valuable to you as possible:

* Are there specific features you’d like to see a demo for? Dynamic Subforms? Conditional Breaks? Data-Nominated Subforms? Data Binding?
* Should he talk about form design methods like why and when to use repeating (dynamic) subforms, how to validate your form prior to submission, etc.?
* Anything else?

Connecting a Form to a Database

In response to “Lala”: and “malik”:′s questions on connecting a form to a database (whether it’s Microsoft Access, MySQL, etc. doesn’t really matter), I decided to write a little tutorial on how to do it.

Even if you already know how to do it, I encourage you to *pay special attention* to the section on *Auto-Incremented Table Columns* because it might help you understand and resolve some of the issues you may have already run into.

Continue reading…

Designer 7 Training by CYTA

I just noticed that Carl Young himself from “Carl Young Training Associates”: is giving a “new course on Designer 7″: this Fall that looks very interesting (here’s the “full course outline”: if you’re looking for details).

They’ll be in *Phoenix*, AZ, Nov. 13 – 14, 2006, and *Houston*, TX, Nov. 27 – 28, 2006.

FormCalc Expressions (If and For)

In Designer, you can write scripts using one of two languages: FormCalc and JavaScript. If you’re like me, you’re more familiar with JavaScript because it’s very similar to Java and JScript syntax but when it comes to FormCalc, you’re lost. Well, not completely but you find it very difficult to find documentation on the syntax for loops (like While, For, etc.) which are sometimes essential. Maybe you fall-back on JavaScript in those times but, on average, *FormCalc scripts execute much faster* than JavaScript scripts so why not harness that performance in our forms?

In this post, I’ll explain the syntax of the *If* and *For* expressions in FormCalc. Those of you familiar with Visual Basic or VBScript will likely find this more familiar than the equivalent JavaScript syntax (while I’ll include for comparison however this isn’t a post on JavaScript syntax). In future posts, I’ll add to this collection by discussing the syntax for *While* and *ForEach* loops.

Continue reading…

Not Just Flash, Flex and Dreamweaver!

Have you seen “Mike Potter’s LiveCycle @ MAX Google Calendar”: ? It’s a great way to see all the “LiveCycle”: -related sessions being offered at the “Adobe MAX 2006″: conference this year.

I think many people still think or expect that MAX is still all about the former Macromedia products such as “Flash”:, “Flex”: and “Dreamweaver”: While there’s still lots of focus on those really cool applications, Adobe has added a whole slew of sessions on LiveCycle products such as “Designer”:, “Workflow”:, “Forms”: and even a preview of what we’ve got in store for “LiveCycle 8″:!

Bug: “Page n of m” Custom Object Broken in Tables

h2. Description

If you use the “Page n of m” object from the Library palette’s Custom tab, you may have noticed a bug when you drag that object from the Library directly into a table cell:

== BugPageNoMCanvas.gif ==

In the image above, the “Page n of m” object circled in green is correct whereas the one circled in red is not.

If you preview the form or run it in stand-alone Acrobat, you’ll get something like this:

== BugPageNoMPreview.gif ==

You can see, in the image above, that the green-circled object is showing the correct page information while the red-circled one isn’t showing any information at all. That’s because the text object from red-circled “Page n of m” object contains broken references to the *Floating Fields* which are used to display the current page and page count information.

Continue reading…

Making a Table of Contents

One of the hottest topics on the “Designer Forums”: these days seems to be methods by which one can add a table of contents to their form. Since there are many different ways to achieve this, I thought I would post a little sample to demonstrate how this can be done.

Of primary concern when adding a table of contents to your form is ensuring that the links provided to the form’s various pages/sections remain valid at all times. Static forms whose page set never changes don’t really need to worry about this but dynamic forms do. That is, regardless of whether content pages are added, re-ordered or even deleted from your dynamic form, you need to ensure that when a TOC link is clicked, the user is taken to the correct page pertaining to the topic they selected.

The best way of ensuring that TOC links don’t get broken as a result of changes to the form’s pages is by using layout information provided by the *XFA Layout Model*. This model provides information such as an object’s actual dimensions (width/height), the page on which it is located as well as a few other interesting pieces of information.

By using the

bc. xfa.layout.absPage

we’re able to get the page number on which an object is currently located, taking into account the various pages which may have been inserted or removed in-between the TOC page and the page in question. Taking that page number and assigning it to the


property then sets the current page to the one on which is located the object in quetsion.

“Download Sample [pdf]“:

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

Continue reading…