| <?xml version="1.0"?> |
| |
| <!--+ |
| | CForms aggregate sample binding. Represent values of two aggregate |
| | fields as single input fields. |
| | |
| | CVS $Id: template-combine.xml,v 1.1 2004/02/29 06:18:28 vgritsenko Exp $ |
| +--> |
| |
| <page xmlns:wt="http://apache.org/cocoon/woody/template/1.0" |
| xmlns:wi="http://apache.org/cocoon/woody/instance/1.0" |
| xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"> |
| <title>Aggregate Field: Combine</title> |
| <content> |
| <p> |
| On this form, you can enter phone and date, each as one field. |
| </p> |
| <wt:form-template action="${cocoon.continuation.id}.continue" method="POST"> |
| <table align="center"> |
| <tr> |
| <th style="border-bottom: solid 1px black;">Explanation</th> |
| <th style="border-bottom: solid 1px black;">Form</th> |
| <th style="border-bottom: solid 1px black;">Data Model</th> |
| </tr> |
| <tr> |
| <td> |
| <p> |
| When you click submit, following happens: |
| <ul> |
| <li>Input values are validated</li> |
| <li>Input values are split onto parts</li> |
| <li>Each part value is validated</li> |
| <li>Each part value saved into the backend data model</li> |
| </ul> |
| </p> |
| <p> |
| Switch to another aggregation example: |
| </p> |
| <wt:widget id="switch"/> |
| </td> |
| <td> |
| <wi:group> |
| <wi:styling layout="columns"/> |
| <wi:items> |
| <wt:widget id="phone"/> |
| <wt:widget id="date"/> |
| </wi:items> |
| </wi:group> |
| <input type="submit" value="Submit"/> |
| </td> |
| <td> |
| <table cellpadding="3"> |
| <tr> |
| <td>Phone, part 1</td><th>#{part1}</th> |
| </tr> |
| <tr> |
| <td>Phone, part 2</td><th>#{part2}</th> |
| </tr> |
| <tr> |
| <td>Phone, part 3</td><th>#{part3}</th> |
| </tr> |
| <tr> |
| <td>Phone, part 4</td><th>#{part4}</th> |
| </tr> |
| <tr> |
| <td>Date, Day</td><th>#{day}</th> |
| </tr> |
| <tr> |
| <td>Date, Month</td><th>#{month}</th> |
| </tr> |
| <tr> |
| <td>Date, Year</td><th>#{year}</th> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| </wt:form-template> |
| </content> |
| </page> |