Auto-Localizing Your Forms
A few days ago, I posted about Designer 7.1’s new Dynamic Properties feature. In that post, I explained how this feature could be used to automatically populate a list box or drop down list field with data from a data connection without having to write any script.
Today, I thought I would highlight one of the main advantages to using this feature: localization of your forms!
By using the Dynamic Properties feature to bind the caption of form fields to data nodes in a data connection, you can easily localize your forms without having to write any script!
To illustrate how this would work, I’ve designed a simple little form which has an address block on it (taken from the “Address Block” custom object that ships with Designer, found under the Custom tab in the Library palette). Each field in the address block (which excludes the “Locale” field at the top that’s just there for informational purposes) has its Caption property bound to a specific data node in the data connection I’ve defined, based on some different localized XML Data files. To localize the form at run-time (e.g. in Acrobat), just open the form and then load the XML Data file pertaining to the locale you want to use.
Minimum Requirements: Designer 7.1, Acrobat Pro 7.0.5.
Note: If you open the form in Acrobat, don’t forget to load a data file into it by using the options under the “File | Form Data” menu.
I should also mention that since it’s possible to have multiple data connections pointing to databases and/or WSDL connections, you could use one connection to localize your form and another to capture the data entered into your form (by binding the field values as usual, using the Binding tab in the Object palette, to data nodes in the second data connection). If you have any questions about this, I’ll be glad to answer them!
Comments
This is not fair!
I was thinking about something very-very similar!
But now, that you did it first, maybe you can also use these ideas, if you find them interesting:
- attach the xml files to the pdf document (so that they are not stand-alone files)
- have the locale in a combo-box, populated at load-time with the languages in attachments, and update the labels when the user changes the selection
Posted by: Mihai | August 2, 2006 8:32 PM
Hi Stefan,
I've got another unrelated question. I'm wondering if it's possible to track the coordinates of a click inside an image field? What I'm wanting to do is to have something like an interactive pie chart for example, where clicking on one of the areas would change something else on the form. I could do this with a simple if statement inside the click event of the field - if I knew the coordinates of the click.
A somewhat hack of this that I have more hope of working is to build the image out of multiple image fields and simply put different scripts on the separate image fields. Oh well, if you have any insight or an opinion on this please share. Thanks,
-Zack
Posted by: Zack | August 3, 2006 1:30 PM
Zack,
Your question was very interesting. So much so that I decided to write an entry about it:
Tracking Mouse Clicks
Let me know what you think.
Posted by: Stefan Cameron | August 5, 2006 12:08 AM