You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by je...@apache.org on 2008/09/14 12:55:05 UTC
svn commit: r695187 - in
/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms:
resources/org/apache/cocoon/forms/resources/ samples/ samples/forms/
Author: jeremy
Date: Sun Sep 14 03:55:05 2008
New Revision: 695187
URL: http://svn.apache.org/viewvc?rev=695187&view=rev
Log:
Fixing some samples. A lot of Repeaters need adapting for JXGenerators changes from 3 years ago. Remove broken styling of plain submit buttons.
Modified:
cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/dynamicrepeater_template.xml
cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/form1.xml
cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/form1_template.xml
cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/group_styles.xml
cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/welcome.xml
Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl?rev=695187&r1=695186&r2=695187&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl Sun Sep 14 03:55:05 2008
@@ -325,10 +325,10 @@
</div>
</xsl:template>
-
<!--+
| Dojoize regular submit buttons
- +-->
+ |
+ | TODO: This currently supplies an invalid submit ID, so commented out, is there a fix?
<xsl:template match="input[@type='submit']">
<script type="text/javascript">dojo.require("dijit.form.Button");</script>
<xsl:copy>
@@ -339,6 +339,7 @@
</xsl:attribute>
</xsl:copy>
</xsl:template>
+ +-->
<!--+
| TODO: Not used
Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/dynamicrepeater_template.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/dynamicrepeater_template.xml?rev=695187&r1=695186&r2=695187&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/dynamicrepeater_template.xml (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/dynamicrepeater_template.xml Sun Sep 14 03:55:05 2008
@@ -24,6 +24,7 @@
<!-- Import the macros that define CForms template elements -->
<jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
+ <jx:import uri="resources/samples-jx-macros.xml"/><!-- common macros for samples -->
<h4 class="samplesGroup">Repeater widget</h4>
<title>Dynamic template</title>
<style type="text/css">
@@ -55,20 +56,19 @@
allowing drag-and-drop support between different repeaters.</p>
<ft:repeater id="contacts" select="select">
<div>
- <jx:choose>
- <jx:when test="${repeater.getSize() == 0}">
- <p><strong><em>There are no contacts to display</em></strong></p>
- </jx:when>
- <jx:otherwise>
-
- <table border="1">
- <tr>
- <th><ft:repeater-widget-label widget-id="firstname"/></th>
- <th><ft:repeater-widget-label widget-id="lastname"/></th>
- <th><ft:repeater-widget-label widget-id="ID"/></th>
- <th><ft:repeater-widget-label widget-id="select"/></th>
- </tr>
- <tbody>
+ <jx:choose>
+ <jx:when test="${repeater.getSize() == 0}">
+ <p><strong><em>There are no contacts to display</em></strong></p>
+ </jx:when>
+ <jx:otherwise>
+ <table border="1">
+ <tr>
+ <th><ft:repeater-widget-label widget-id="firstname"/></th>
+ <th><ft:repeater-widget-label widget-id="lastname"/></th>
+ <th><ft:repeater-widget-label widget-id="ID"/></th>
+ <th><ft:repeater-widget-label widget-id="select"/></th>
+ </tr>
+ <tbody>
<!-- The contents of the repeater-widget element is a template that will
be applied to each row in the repeater. -->
<ft:repeater-rows>
@@ -104,20 +104,24 @@
</tr>
</ft:repeater-rows>
</tbody>
- </table>
- </jx:otherwise>
- </jx:choose>
- <p>
- <ft:widget id="../addcontact"/>
- <jx:if test="${widget.getSize() > 0}">
- <ft:widget id="../removecontacts"/>
- </jx:if>
- </p>
- </div>
- </ft:repeater>
- <ft:widget id="ok"/><br/>
- <a href="./do-dynaRepeater.flow">Restart this sample</a> - <a href="./">Back to samples</a>
-
+ </table>
+ </jx:otherwise>
+ </jx:choose>
+ <p>
+ <ft:widget id="../addcontact"/>
+ <jx:if test="${widget.getSize() > 0}">
+ <ft:widget id="../removecontacts"/>
+ </jx:if>
+ </p>
+ </div>
+ </ft:repeater>
+ <ft:widget id="ok"/><br/>
+ <p>
+ <a href="./do-dynaRepeater.flow">Restart this sample</a> - <a href="./">Back to samples</a>
+ </p>
+ <p align="center">
+ <sample-theme-chooser/><!-- a macro from samples-jx-macros.xml -->
+ </p>
</ft:form-template>
</content>
</page>
Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/form1.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/form1.xml?rev=695187&r1=695186&r2=695187&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/form1.xml (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/form1.xml Sun Sep 14 03:55:05 2008
@@ -141,7 +141,7 @@
</fd:validation>
</fd:field>
- <fd:multivaluefield id="drinks">
+ <!--<fd:multivaluefield id="drinks">
<fd:label>Indicate which 2 of the following drinks you'd like to receive:</fd:label>
<fd:datatype base="string"/>
<fd:validation>
@@ -159,7 +159,7 @@
<fd:multivaluefield id="freemv">
<fd:label>Here you can enter values freely:</fd:label>
<fd:datatype base="string"/>
- </fd:multivaluefield>
+ </fd:multivaluefield>-->
<fd:aggregatefield id="visa" required="true">
<fd:label>Enter your (16-digit) visa number (without spaces)
Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/form1_template.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/form1_template.xml?rev=695187&r1=695186&r2=695187&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/form1_template.xml (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/form1_template.xml Sun Sep 14 03:55:05 2008
@@ -24,11 +24,16 @@
<!-- Import the macros that define CForms template elements -->
<jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
+ <jx:import uri="resources/samples-jx-macros.xml"/><!-- common macros for samples -->
<h4 class="samplesGroup">Widget sampler (Flowscript)</h4>
<title>Sample form</title>
<content>
<ft:form-template action="#{$cocoon/continuation/id}.continue" method="POST">
<div style="width: 90%; margin: 10px 50px 50px 50px;">
+<fi:validation-errors>
+ <header><p>Correct these errors please:</p></header>
+ <footer><p>And then resubmit the form.</p></footer>
+</fi:validation-errors>
<!-- group with tabs. Each of the children of <items> will constitute a tab -->
<fi:group>
<fi:styling type="choice"/>
@@ -104,54 +109,60 @@
</fi:group>
<!-- manual layout of fields, without use of a fi:group -->
- <ft:widget-label id="contacts"/><br/>
- <ft:repeater-size id="contacts"/>
- <table border="1">
- <tr>
- <th><ft:repeater-widget-label id="contacts" widget-id="firstname"/></th>
- <th><ft:repeater-widget-label id="contacts" widget-id="lastname"/></th>
- <th><ft:repeater-widget-label id="contacts" widget-id="phone"/></th>
- <th><ft:repeater-widget-label id="contacts" widget-id="email"/></th>
- <th><ft:repeater-widget-label id="contacts" widget-id="birthdate"/></th>
- <th><ft:repeater-widget-label id="contacts" widget-id="select"/></th>
- </tr>
- <jx:choose>
- <jx:when test="${widget.getChild('contacts').getSize() == 0}">
- <tr><td colspan="6" align="center"><em>There are no contacts to display</em></td></tr>
- </jx:when>
- <jx:otherwise>
- <!-- The contents of the repeater-widget element is a template that will
- be applied to each row in the repeater. -->
- <ft:repeater-widget id="contacts">
- <tr>
- <td><ft:widget id="firstname"/></td>
- <td><ft:widget id="lastname"/></td>
- <td><ft:widget id="phone"/></td>
- <td><ft:widget id="email"/></td>
- <td><ft:widget id="birthdate"/></td>
- <td><ft:widget id="select"/></td>
- </tr>
- </ft:repeater-widget>
- </jx:otherwise>
- </jx:choose>
- <tr>
- <td colspan="6">
- <ft:widget id="addtwocontacts"/>
- <ft:widget id="addcontact"/>
- <jx:if test="${widget.getChild('contacts').getSize() > 0}">
- <ft:widget id="removecontacts"/>
- <br/>
- <small>Hint: remove all contacts to see how dynamic form templates can change
- their layout depending on widget values</small>
- </jx:if>
- </td>
- </tr>
- </table>
+
+ <ft:repeater id="contacts" select="select">
+ <table border="1">
+ <tr>
+ <th><ft:repeater-widget-label id="contacts" widget-id="firstname"/></th>
+ <th><ft:repeater-widget-label id="contacts" widget-id="lastname"/></th>
+ <th><ft:repeater-widget-label id="contacts" widget-id="phone"/></th>
+ <th><ft:repeater-widget-label id="contacts" widget-id="email"/></th>
+ <th><ft:repeater-widget-label id="contacts" widget-id="birthdate"/></th>
+ <th><ft:repeater-widget-label id="contacts" widget-id="select"/></th>
+ </tr>
+ <tbody>
+ <jx:choose>
+ <jx:when test="${repeater.getSize() == 0}">
+ <tr><td colspan="6" align="center"><em>There are no contacts to display</em></td></tr>
+ </jx:when>
+ <jx:otherwise>
+ <ft:repeater-rows>
+ <tr>
+ <td><ft:widget id="firstname"/></td>
+ <td><ft:widget id="lastname"/></td>
+ <td><ft:widget id="phone"/></td>
+ <td><ft:widget id="email"/></td>
+ <td><ft:widget id="birthdate"/></td>
+ <td><ft:widget id="select"/></td>
+ </tr>
+ </ft:repeater-rows>
+ </jx:otherwise>
+ </jx:choose>
+ <tr>
+ <td colspan="6">
+ <ft:widget id="../addtwocontacts"/>
+ <ft:widget id="../addcontact"/>
+ <jx:if test="${repeater.getSize() > 0}">
+ <ft:widget id="../removecontacts"/>
+ <br/>
+ <small>Hint: remove all contacts to see how dynamic form templates can change
+ their layout depending on widget values</small>
+ </jx:if>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </ft:repeater>
+
<input type="submit"/>
+ <p>
+ <a href="./form1.flow">Restart this sample</a> - <a href="./">Back to samples</a>
+ </p>
+ <p align="center">
+ <sample-theme-chooser/><!-- a macro from samples-jx-macros.xml -->
+ </p>
+
</div>
</ft:form-template>
- <p>
- <a href="./">Back to Forms samples</a>
- </p>
</content>
</page>
Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/group_styles.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/group_styles.xml?rev=695187&r1=695186&r2=695187&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/group_styles.xml (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/forms/group_styles.xml Sun Sep 14 03:55:05 2008
@@ -142,7 +142,7 @@
</fd:validation>
</fd:field>
- <fd:multivaluefield id="drinks">
+ <!--<fd:multivaluefield id="drinks">
<fd:label>Indicate which 2 of the following drinks you'd like to receive</fd:label>
<fd:datatype base="string"/>
<fd:validation>
@@ -160,7 +160,7 @@
<fd:multivaluefield id="freemv">
<fd:label>Here you can enter values freely</fd:label>
<fd:datatype base="string"/>
- </fd:multivaluefield>
+ </fd:multivaluefield>-->
<fd:aggregatefield id="visa" required="true">
<fd:label>Enter your (16-digit) visa number (without spaces)
Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/welcome.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/welcome.xml?rev=695187&r1=695186&r2=695187&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/welcome.xml (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/forms/samples/welcome.xml Sun Sep 14 03:55:05 2008
@@ -34,7 +34,7 @@
<note>
<b>TODO:</b> Several of these samples use deprecated FormsGenerator so have various problems
</note>
- <sample name="Various (Actions)" href="form1">This sample shows validation, event handling and various Cocoon Forms features. <b>TODO:</b> Not processed properly by XSLT, missing Widget implementations.</sample>
+ <sample name="Various (Actions)" href="form1">This sample shows validation, event handling and various Cocoon Forms features.</sample>
<sample name="Various (Flowscript)" href="form1.flow">The same sample as above using Flowscript. <b>TODO:</b> Repeater not working.</sample>
<sample name="Registration" href="registration">A simple registration form. <b>TODO:</b> Not processed properly by XSLT.</sample>
<sample name="Car selector" href="carselector">(Ajax) Illustrates programmatically changing selectionlists.</sample>
@@ -100,7 +100,7 @@
</group>
<group name="New Samples">
- <sample name="Group Styling" href="do-groupStyles.flow">This sample shows the new grouping styles. <b>TODO:</b> form not finalising.</sample>
+ <sample name="Group Styling" href="do-groupStyles.flow">This sample shows the new grouping styles.</sample>
<sample name="Formatted Numbers" href="do-numbers.flow">Samples of some of the different ways you can present and validate numbers on the client.</sample>
<sample name="Lists" href="do-lists.flow">Samples of different ways you can present and interact with lists.</sample>
<sample name="Editors & TextAreas" href="do-textareas.flow">Several different types of text editor.</sample>