You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by br...@apache.org on 2003/05/14 13:36:47 UTC
cvs commit: cocoon-2.1/src/blocks/woody/samples/xsl/html woody-default.xsl
bruno 2003/05/14 04:36:47
Modified: src/blocks/woody/samples sitemap.xmap
src/blocks/woody/samples/forms form1.xml form1_template.xml
src/blocks/woody/samples/xsl/html woody-default.xsl
Log:
extended samples with buttons and event handling
Revision Changes Path
1.3 +1 -0 cocoon-2.1/src/blocks/woody/samples/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/sitemap.xmap,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sitemap.xmap 13 May 2003 11:49:20 -0000 1.2
+++ sitemap.xmap 14 May 2003 11:36:46 -0000 1.3
@@ -60,6 +60,7 @@
<map:act type="woody-handle-form-submit">
<map:parameter name="form-definition" value="forms/form1.xml"/>
<map:parameter name="attribute-name" value="form1"/>
+ <map:parameter name="formhandler" value="org.apache.cocoon.woody.samples.Form1Handler"/>
<!-- the content of this action is only executed in case validation
succeeded, thus if the form handling is completed -->
1.3 +11 -0 cocoon-2.1/src/blocks/woody/samples/forms/form1.xml
Index: form1.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/forms/form1.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- form1.xml 30 Apr 2003 08:38:45 -0000 1.2
+++ form1.xml 14 May 2003 11:36:46 -0000 1.3
@@ -109,6 +109,17 @@
</wd:validation>
</wd:datatype>
</wd:field>
+ <wd:booleanfield id="select">
+ <wd:label>Select</wd:label>
+ </wd:booleanfield>
</wd:repeater>
+
+ <wd:button id="addcontact" action-command="add-contact">
+ <wd:label>Add contact</wd:label>
+ </wd:button>
+
+ <wd:button id="removecontacts" action-command="remove-selected-contacts">
+ <wd:label>Remove selected contacts</wd:label>
+ </wd:button>
</wd:form>
1.3 +9 -0 cocoon-2.1/src/blocks/woody/samples/forms/form1_template.xml
Index: form1_template.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/forms/form1_template.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- form1_template.xml 30 Apr 2003 08:38:45 -0000 1.2
+++ form1_template.xml 14 May 2003 11:36:46 -0000 1.3
@@ -59,6 +59,7 @@
<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
@@ -69,8 +70,16 @@
<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"/>
1.3 +6 -0 cocoon-2.1/src/blocks/woody/samples/xsl/html/woody-default.xsl
Index: woody-default.xsl
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/xsl/html/woody-default.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- woody-default.xsl 30 Apr 2003 08:38:45 -0000 1.2
+++ woody-default.xsl 14 May 2003 11:36:46 -0000 1.3
@@ -92,6 +92,12 @@
</input>
</xsl:template>
+ <xsl:template match="wi:button">
+ <button name="{@id}" value="selected" type="submit">
+ <xsl:copy-of select="wi:label/node()"/>
+ </button>
+ </xsl:template>
+
<xsl:template match="wi:multivaluefield">
<xsl:if test="wi:validation-message">
<xsl:call-template name="validation-message">