![]() ![]() ![]() These elements correspond to the “100” (id) and “Jim Jones” (name) values in the database (we will show how the schema is connected to the database in the following section). Remember that there were three testUsers in the database (Jim, Sally and Fred), yet here we only have one “Tester” element that contains the “id” and “name” elements. These elements are bound to the “testUsers” section of the database which looked like this: testUsers values (100, 'Jim Jones', 0). Lastly, note how there are only two element values-one for “name” and one for “id” in the schema. This attribute value must be set in the schema in order for the “” convention to work in LiveCycle. Notice also how this element has a maxOccurs attribute value set to unbounded. When we bound this schema to the drop-down list object, we bound it at the “Tester” level of schema hierarchy. Remember that in the schema, we had a segment that looked like this (see Figure 7): Notice the “” convention that is used here, this convention is used whenever a schema element is going to be iterated over multiple times. ![]() The data input field should populate with the following value: $ Navigate to the “Tester” level of hierarchy. On the “Items” line, click on the “navigation” object to the right of the “Items” input field. In the middle of this tab, click on the green “ListItems:” link object. In “Object” Pallette for the drop-down list (by default in the lower right-hand side of the Designer IDE, two tabs over from “Layout”) and navigate to the “Field” subtab (See Figure 6). Navigate back to the drop-down list in the body of the form and click on it. Note also that this item is a complexType that has a sequence of “Tester” sub-elements, this “Tester” type in turn, is also a complexType that contains a series of values that include the “id” and the “name” for the objects that will eventually appear in the dropdown list. The important part of the schema code for this tutorial is the testerList element. Note, though the firstName and lastName items are in the pictured schema, these are not required for the drop-down list population. In either event, you will need to create a simple schema document as displayed in the schema below. ![]() At this point, you will need to drag the XSD file (from wherever you saved it after editing) and drag and drop the document into your schema folder. Once the file has been created, name the schema accordingly and be sure to save the schema with the “.xsd” file extension. The benefit of using an editor like Notepad++ is once you put in your XML doctype declaration at the top of the text document in the editor, the editor uses color to make coding easier. Option Two: Create the schema document using a third-party editor like Notepad ++.You can then use the editor to write the rest of the schema code and then save the schema document (being sure to use the “.xsd” file extension). Workbench will open the default text editor associated with Workbench and the new file (a text file) will have the appropriate doctype declaration and base schema tag structure in place for an XML schema. Option One: Right-click on the newly created “schema” folder and opt to create a new XML schema file.Once the folder has been created, complete one of the following actions to create a schema: In both options, the first step is to create a “schema” folder in your LiveCycle project hierarchy in Workbench. The next step is to create an XSD Schema document. This tutorial also assumes that you are familiar with how to create and edit tables in MySql and will not cover those topics in depth, as the main focus of this tutorial is how to bind these data sources to the dropdown list form object. This tutorial describes using a MySql database as the back-end data source, though the general principles in binding this data source to the form are the same despite which back-end LiveCycle-compliant database you choose to use. We will then add three rows into the database table, and we will create a simple PDF form in Designer that will include a drop-down list that is automatically pre-populated by this data source. To illustrate the process we will create a simple table in a MySql database. A common use of this concept is having a dropdown list in a dynamic PDF pre-populate with data from a database. An electronic form once wired to a back-end data source can be dynamically updated at any time. A form need not be created with one set of data and then left that way indefinitely. One of the main benefits of electronic forms is their dynamic nature. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |