Filling in Forms with Sample Data
The "Fill Form" button on this sample can be dragged and dropped into your Designer Custom Object Library and reused on other forms to help populate those forms with random sample data. The script in the button simply looks through the form (xfa.form) finding each of the fields (using myNode.nodes.item(0).className) and filling in their values.
Comments
Great tool for all versions of Designer!
You'll also find that LC Designer ES has built-in capabilities for generating sample data by going to the "File > Form Properties" command and choosing the Preview tab. There, you'll find a "Generate Preview Data" button. It has facilities to generate an XML data file taking into account fields as well as repeating subforms.
Posted by: Stefan Cameron | December 19, 2007 07:39 AM
Excellent point Stefan. To add a little more detail to the reasons behind the "button", from the Barcoded Forms perspective it's important that fields be filled to their maximum capacity as well as allow the user to select which characters they wish to use when testing the form. Accented characters or double-byte character set characters can take up 4 times more space than an English language form.
In addition to the sample data, the code behind the button demonstrates to a developer how to traverse an entire document and the objects within that document. Which, come to think of it, I could demonstrate a little more affectively (new sample soon).
Posted by: Lee Sutton | December 19, 2007 08:56 AM