| <?xml version="1.0"?> |
| <page xmlns:wt="http://apache.org/cocoon/woody/template/1.0" |
| xmlns:wi="http://apache.org/cocoon/woody/instance/1.0"> |
| <title>Sample form</title> |
| <content> |
| <p>This form is used to illustrate the Woody binding framework. The binding |
| is based on JXPath and hence works both with XML documents and beans. |
| Some warnings and limitations of the current implementation:</p> |
| <ul> |
| <li>the email address is marked in the binding as "read-only", meaning it |
| will only be bound from bean/xml to form, but not in the other |
| direction. So you won't see it changed in the bean or the XML.</li> |
| <li>The binding doesn't support all widget types yet.</li> |
| <li>Note how, in the XML binding, the date is formatted according XML |
| Schema date format in the XML, while it is displayed in another format |
| to the user, and is stored in the form model as a Java Date |
| object (useful for date-specific validations).</li> |
| </ul> |
| <p>If you're running the XML-binding demo, then after successful submit |
| you'll see the updated XML.</p> |
| <p>If you're running the bean-binding demo, then after successful submit |
| you'll be shown a page that uses the JXTemplateGenerator to extract |
| data from the bean (to show that the bean really has been updated).</p> |
| <wt:form-template action="#{$continuation/id}.continue" method="POST"> |
| <table border="1"> |
| <tr> |
| <td valign="top"><wt:widget-label id="email"/></td> |
| <td valign="top"><wt:widget id="email"/></td> |
| </tr> |
| <tr> |
| <td valign="top"><wt:widget-label id="phone"/></td> |
| <td valign="top"><wt:widget id="phone" /></td> |
| </tr> |
| <tr> |
| <td valign="top"><wt:widget-label id="ipaddress"/></td> |
| <td valign="top"><wt:widget id="ipaddress"/></td> |
| </tr> |
| <tr> |
| <td valign="top"><wt:widget-label id="birthday"/></td> |
| <td valign="top"><wt:widget id="birthday"/></td> |
| </tr> |
| <tr> |
| <td valign="top"><wt:widget-label id="number"/></td> |
| <td valign="top"><wt:widget id="number"/></td> |
| </tr> |
| <tr> |
| <td/> |
| <td valign="top"><wt:widget id="choose"/> <wt:widget-label id="choose"/></td> |
| </tr> |
| <tr> |
| <td valign="top"><wt:widget-label id="sex"/></td> |
| <td valign="top"><wt:widget id="sex"/></td> |
| </tr> |
| <tr> |
| <td valign="top"><wt:widget-label id="drinks"/></td> |
| <td valign="top"> |
| <wt:widget id="drinks"> |
| <wi:styling list-type="listbox" listbox-size="4"/> |
| </wt:widget> |
| </td> |
| </tr> |
| </table> |
| |
| <wt:widget-label id="contacts"/><br/> |
| <wt:repeater-size id="contacts"/> |
| <table border="1"> |
| <tr> |
| <th><wt:repeater-widget-label id="contacts" widget-id="firstname"/></th> |
| <th><wt:repeater-widget-label id="contacts" widget-id="lastname"/></th> |
| <th><wt:repeater-widget-label id="contacts" widget-id="phone"/></th> |
| <th><wt:repeater-widget-label id="contacts" widget-id="email"/></th> |
| <th><wt:repeater-widget-label id="contacts" widget-id="select"/></th> |
| </tr> |
| |
| <!-- The contents of the repeater-widget element is a template that will |
| be applied to each row in the repeater. --> |
| <wt:repeater-widget id="contacts"> |
| <tr> |
| <!-- Don't show the id |
| <td>[<wt:widget id="id"/>]</td> |
| --> |
| <td><wt:widget id="firstname"/></td> |
| <td><wt:widget id="lastname"/></td> |
| <td><wt:widget id="phone"/></td> |
| <td><wt:widget id="email"/></td> |
| <td><wt:widget id="select"/></td> |
| </tr> |
| </wt:repeater-widget> |
| |
| <tr> |
| <td colspan="4" align="right"> |
| <wt:widget id="addcontact"/> |
| <wt:widget id="removecontacts"/> |
| </td> |
| </tr> |
| </table> |
| |
| <input type="submit"/> |
| </wt:form-template> |
| </content> |
| </page> |