cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject cvs commit: cocoon-2.1/src/blocks/woody/samples/forms form2_template.xml
Date Fri, 25 Jul 2003 09:01:40 GMT
bruno       2003/07/25 02:01:40

  Added:       src/blocks/woody/samples/forms form2_template.xml
  replaces the previous from2_template.xsp
  Revision  Changes    Path
  1.1                  cocoon-2.1/src/blocks/woody/samples/forms/form2_template.xml
  Index: form2_template.xml
  <?xml version="1.0"?>
  <page xmlns:wt="">
    <title>Sample form</title>
      <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>
        <li>In the repeater (the list of contacts), you should not modify the id
          column. For newly added rows leave the id blank, for existing rows do
          not modify it. In the future this will become a hidden and read-only
          widget. Other repeater-binding strategies that do not depend on an id
          field could of course be created.</li>
        <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 (e.g. the
          multivaluefield is currently not yet supported).</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>
      <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">
            <td valign="top"><wt:widget-label id="email"/></td>
            <td valign="top"><wt:widget id="email"/></td>
            <td valign="top"><wt:widget-label id="phone"/></td>
            <td valign="top"><wt:widget id="phone" /></td>
            <td valign="top"><wt:widget-label id="ipaddress"/></td>
            <td valign="top"><wt:widget id="ipaddress"/></td>
            <td valign="top"><wt:widget-label id="birthday"/></td>
            <td valign="top"><wt:widget id="birthday"/></td>
            <td valign="top"><wt:widget-label id="number"/></td>
            <td valign="top"><wt:widget id="number"/></td>
        <wt:widget-label id="contacts"/><br/>
        <wt:repeater-size id="contacts"/>
        <table border="1">
            <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>
          <!-- 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">
              <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>
            <td colspan="4" align="right">
              <wt:widget id="addcontact"/>
              <wt:widget id="removecontacts"/>
        <input type="submit"/>

View raw message