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”:http://blogs.adobe.com/formbuilder/2006/09/connecting_a_form_to_a_database.html#comment-34179 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”:http://blogs.adobe.com/formbuilder/2006/09/connecting_a_form_to_a_database.html, 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…
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
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
object/property of the Change event itself and possibly the list object’s
function in order to determine the _value_ associated with the new selection.
“Mike Potter”:http://blogs.adobe.com/mikepotter will be giving a “training session”:http://www.adobe.com/events/max/sessions/lt101h.html on LiveCycle Designer at “Adobe MAX 2006″:http://www.adobe.com/events/max 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?
In response to “Lala”:http://blogs.adobe.com/formbuilder/2006/08/importing_data_in_acrobat_1.html#comment-28257 and “malik”:http://blogs.adobe.com/formbuilder/2006/08/importing_data_in_acrobat_1.html#comment-29712’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.
I just noticed that Carl Young himself from “Carl Young Training Associates”:http://www.pdftrain.com is giving a “new course on Designer 7″:http://www.pdftrain.com/Designer.html this Fall that looks very interesting (here’s the “full course outline”:http://www.pdftrain.com/PDFs/Designer7_1_TOC.pdf if you’re looking for details).
They’ll be in *Phoenix*, AZ, Nov. 13 – 14, 2006, and *Houston*, TX, Nov. 27 – 28, 2006.
Have you seen “Mike Potter’s LiveCycle @ MAX Google Calendar”:http://blogs.adobe.com/mikepotter/2006/09/adobe_livecycle_1.html ? It’s a great way to see all the “LiveCycle”:http://www.adobe.com/products/livecycle -related sessions being offered at the “Adobe MAX 2006″:http://www.adobe.com/events/max conference this year.
I think many people still think or expect that MAX is still all about the former Macromedia products such as “Flash”:http://www.adobe.com/products/flash/flashpro, “Flex”:http://www.adobe.com/products/flex and “Dreamweaver”:http://www.adobe.com/products/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”:http://www.adobe.com/products/server/adobedesigner, “Workflow”:http://www.adobe.com/products/server/workflowserver, “Forms”:http://www.adobe.com/products/server/formserver and even a preview of what we’ve got in store for “LiveCycle 8″:http://www.adobe.com/events/max/sessions/lt203w.html!
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:
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:
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.
One of the hottest topics on the “Designer Forums”:http://www.adobeforums.com/cgi-bin/webx/.3bb7d189 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
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]“:http://blogs.adobe.com/formbuilder/samples/TOCUsingXFALayoutModel.pdf
*Minimum Requirements:* Designer 7.x, Acrobat 7.x.