...
- Make a copy of the form from Example 4 above and open it for editing.
- We can hide the Order Info section since it does not contain information entered by the user. Select the section by clicking on its header and uncheck the Visible checkbox in the properties pane. The entire section should grey out.
- In the properties panel on the left, open the Data Sources pane by clicking on it.
- Click 'New from XSD'.
- You should see your schema in the resulting dialog box. Expand it and add the 'createOrderDetail' element to the form by clicking the + icon next to it.
- Close the dialog box by clicking X in the top right corner.
- In the Data Sources pane, expand the createOrderDetail data source by clicking on the + icon to the left.
- Click the + icon next to the row element. will generate controls in the form. Note that automatically generates a repeating element since a single Order can contain any number of line items.
- You can drag and drop to re-arrange as you wish.
- Rename the Section named Row to Order Line.
- Name the repeat control OrderLines. Take note of the "s" in the name.
- Select the Product Code input control and in . In the properties pane set panel:
- Set the name to pc.
- Select Dropdown from the Display As property list.
- Select the Onum control inside the Order Line section and in the properties pane set the name to olonum. Uncheck the Visible property.
- Select the Order Line Number control inside the Order Line section and in the properties pane set the name to oln. Uncheck the Visible property.
- Set default values in the Onum and Cnum controls inside the Order Info section and in the Onum and Order Line Number controls inside the Order Line section. You can set any values since we will be overriding them in a rule. We need to set a default value otherwise will grey will gray out the Submit button and the form cannot be submitted.
...
When the form is submitted, will issue an HTTP PUT request to the above URL sending the customerCreditLimit XML document in the payload. The database connector will map this to the <update> operation of the customerCreditLimit query that we defined above, will use the data in the XML document to resolve the query (replace {creditLimit} and {cnum} in the query with the actual values from the XML document) and perform the UPDATE.
...
Code Block |
---|
<query name=" |
...
<retrieve>
...
customerByNumber“> <retrieve> <!-- maps to HTTP GET --> |
...
<statement>
SELECT * from Customers where customerNumber={cnum}
</statement>
</retrieve>
...
<statement>
SELECT * from Customers where customerNumber={cnum}
</statement>
</retrieve>
</query> |