You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2007/09/27 21:57:38 UTC
svn commit: r580139 [14/28] - in /cocoon/site/site/2.2: ./ blocks/
blocks/ajax/ blocks/ajax/1.0/ blocks/ajax/1.0/apidocs/ blocks/ajax/1.0/css/
blocks/ajax/1.0/images/ blocks/ajax/1.0/images/logos/ blocks/css/
blocks/forms/ blocks/forms/1.0/ blocks/form...
Added: cocoon/site/site/2.2/blocks/forms/1.0/740_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/740_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/740_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/740_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,466 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="489_1_1.html">Basics</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <a href="477_1_1.html">Widgets</a>
+ <ul>
+
+ <li >
+ <a href="477_1_1.html">Action widget</a>
+ </li>
+
+ <li >
+ <a href="486_1_1.html">Aggregatefield widget</a>
+ </li>
+
+ <li >
+ <a href="482_1_1.html">Booleanfield widget</a>
+ </li>
+
+ <li >
+ <a href="1161_1_1.html">Calculated fields</a>
+ </li>
+
+ <li >
+ <a href="1294_1_1.html">Captcha Widget</a>
+ </li>
+
+ <li >
+ <a href="742_1_1.html">Class/New (not really widgets)</a>
+ </li>
+
+ <li >
+ <a href="481_1_1.html">Field widget</a>
+ </li>
+
+ <li >
+ <a href="754_1_1.html">Form</a>
+ </li>
+
+ <li >
+ <strong>Group/Struct widget</strong>
+ </li>
+
+ <li >
+ <a href="738_1_1.html">ImageMap widget</a>
+ </li>
+
+ <li >
+ <a href="497_1_1.html">Messages widget</a>
+ </li>
+
+ <li >
+ <a href="490_1_1.html">MultiValueField widget</a>
+ </li>
+
+ <li >
+ <a href="492_1_1.html">Output widget</a>
+ </li>
+
+ <li >
+ <a href="494_1_1.html">RepeaterAction widget</a>
+ </li>
+
+ <li >
+ <a href="496_1_1.html">Repeater widget</a>
+ </li>
+
+ <li >
+ <a href="495_1_1.html">RowAction widget</a>
+ </li>
+
+ <li >
+ <a href="493_1_1.html">Submit widget</a>
+ </li>
+
+ <li >
+ <a href="739_1_1.html">Tree widget</a>
+ </li>
+
+ <li >
+ <a href="741_1_1.html">Union widget</a>
+ </li>
+
+ <li >
+ <a href="483_1_1.html">Upload widget</a>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="484_1_1.html">Widget concepts</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Form publishing</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="488_1_1.html">Binding</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="750_1_1.html">Ajax</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="904_1_1.html">Action</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="915_1_1.html">Generator</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">Group/Struct widget</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Concept</h1><p>A group widget is simply a container for a number of other widgets. This can
+be useful to:</p><ul>
+<li>change the <a href="733_1_1.html">state</a> of the grouped widgets as a whole
+</li>
+<li>to use in a <a href="741_1_1.html">union widget</a></li>
+<li>....</li>
+</ul>The group widget was previously called struct.<h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Definition</h1><pre><fd:group id="..." state="...">
+ <fd:widgets>
+ [...]
+ </fd:widgets>
+ <fd:validation>
+ [...]
+ </fd:validation>
+ <fd:on-create>
+ [...]
+ </fd:on-create>
+ <fd:attributes>
+ <fd:attribute name="..." value="..."/>
+ </fd:attributes>
+</fd:group>
+</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Template</h1>A group widget is inserted in a template using the ft:group tag. The content
+of the ft:group widget is the template for the children of the group widget,
+thus should contain the template tags for these child widgets.<pre><ft:group id="...">
+ [...]
+</ft:group>
+</pre><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Example</h2>For a definition like this:<pre><fd:group id="mygroup">
+ <fd:widgets>
+ <fd:field id="field1"/>
+ <fd:field id="field2"/>
+ </fd:widgets>
+</fd:group></pre><p>The template could look like this:</p><pre><ft:group id="mygroup">
+ <ft:widget id="field1"/>
+ <br/>
+ <ft:widget id="field2"/>
+</ft:group>
+</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Styling (default HTML XSL)</h1><p>N/A</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/740?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>
Added: cocoon/site/site/2.2/blocks/forms/1.0/741_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/741_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/741_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/741_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,504 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="489_1_1.html">Basics</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <a href="477_1_1.html">Widgets</a>
+ <ul>
+
+ <li >
+ <a href="477_1_1.html">Action widget</a>
+ </li>
+
+ <li >
+ <a href="486_1_1.html">Aggregatefield widget</a>
+ </li>
+
+ <li >
+ <a href="482_1_1.html">Booleanfield widget</a>
+ </li>
+
+ <li >
+ <a href="1161_1_1.html">Calculated fields</a>
+ </li>
+
+ <li >
+ <a href="1294_1_1.html">Captcha Widget</a>
+ </li>
+
+ <li >
+ <a href="742_1_1.html">Class/New (not really widgets)</a>
+ </li>
+
+ <li >
+ <a href="481_1_1.html">Field widget</a>
+ </li>
+
+ <li >
+ <a href="754_1_1.html">Form</a>
+ </li>
+
+ <li >
+ <a href="740_1_1.html">Group/Struct widget</a>
+ </li>
+
+ <li >
+ <a href="738_1_1.html">ImageMap widget</a>
+ </li>
+
+ <li >
+ <a href="497_1_1.html">Messages widget</a>
+ </li>
+
+ <li >
+ <a href="490_1_1.html">MultiValueField widget</a>
+ </li>
+
+ <li >
+ <a href="492_1_1.html">Output widget</a>
+ </li>
+
+ <li >
+ <a href="494_1_1.html">RepeaterAction widget</a>
+ </li>
+
+ <li >
+ <a href="496_1_1.html">Repeater widget</a>
+ </li>
+
+ <li >
+ <a href="495_1_1.html">RowAction widget</a>
+ </li>
+
+ <li >
+ <a href="493_1_1.html">Submit widget</a>
+ </li>
+
+ <li >
+ <a href="739_1_1.html">Tree widget</a>
+ </li>
+
+ <li >
+ <strong>Union widget</strong>
+ </li>
+
+ <li >
+ <a href="483_1_1.html">Upload widget</a>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="484_1_1.html">Widget concepts</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Form publishing</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="488_1_1.html">Binding</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="750_1_1.html">Ajax</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="904_1_1.html">Action</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="915_1_1.html">Generator</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">Union widget</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Concept</h1><p>Uses one out of a set of widgets based on the value of a certain other
+widget.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Definition</h1><pre><fd:union id="..." case="..." state="...">
+ <fd:widgets>
+ [...]
+ </fd:widgets>
+ <fd:on-create>
+ [...]
+ </fd:on-create>
+ <fd:attributes>
+ <fd:attribute name="..." value="..."/>
+ </fd:attributes>
+</fd:union>
+</pre><p>The <tt>case</tt> attribute specifies the ID of a widget that will be used to
+select which one of the widgets will be active (the value of the case widget
+should correspond to the ID of one of those widgets). This case widget will most
+often be a field with a selection list.</p><p>If you want to switch between sets of widgets, you can group them into
+<a href="740_1_1.html">group widgets</a>.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Template</h1><p>Insertion of a union widget in a template is done using <tt>ft:union</tt>
+and <tt>ft:case</tt> elements:</p><pre><ft:union id="...">
+ <ft:case id="...">
+ [...]
+ </ft:case>
+ [... more ft:case elements ...]
+</ft:union>
+</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Example</h1><p>Definition:</p><pre><fd:field id="testcase">
+ <fd:datatype base="string"/>
+ <fd:selection-list>
+ <fd:item value="case1"><fd:label>Case 1</fd:label></fd:item>
+ <fd:item value="case2"><fd:label>Case 2</fd:label></fd:item>
+ </fd:selection-list>
+</fd:field>
+
+<fd:union id="testunion" case="testcase">
+ <fd:widgets>
+ <fd:group id="case1">
+ <fd:field id="field1">
+ <fd:datatype base="string"/>
+ </fd:field>
+ <fd:field id="field2">
+ <fd:datatype base="string"/>
+ </fd:field>
+ </fd:group>
+ <fd:group id="case2">
+ <fd:field id="field1">
+ <fd:datatype base="long"/>
+ </fd:field>
+ <fd:field id="field2">
+ <fd:datatype base="long"/>
+ </fd:field>
+ </fd:group>
+ </fd:widgets>
+</fd:union>
+</pre><p>Template:</p><pre><ft:widget id="testcase">
+ <fi:styling list-type="dropdown" submit-on-change="true"/>
+</ft:widget>
+
+<ft:union id="testunion">
+ <ft:case id="case1">
+ <ft:group id="case1">
+ <ft:widget id="field1"/>
+ <ft:widget id="field2"/>
+ </ft:group>
+ </ft:case>
+ <ft:case id="case2">
+ <ft:group id="case2">
+ <ft:widget id="field1"/>
+ <ft:widget id="field2"/>
+ </ft:group>
+ </ft:case>
+</ft:union>
+</pre><div class="note"><div><strong>Note: </strong>Note the use of <tt xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">submit-on-change</tt> on the case widget to
+let the union widget automatically switch when the case is changed.</div></div><div class="note"><div><strong>Note: </strong>Don't forget the group tags inside the case tags! <br xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0"></br>
+If you do, an update of the form will result in a <br xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0"></br>
+<em xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">org.apache.cocoon.forms.FormsRuntimeException: Union 'testunion' has no
+child named 'field1'</em></div></div></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/741?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>
Added: cocoon/site/site/2.2/blocks/forms/1.0/742_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/742_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/742_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/742_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,432 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="489_1_1.html">Basics</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <a href="477_1_1.html">Widgets</a>
+ <ul>
+
+ <li >
+ <a href="477_1_1.html">Action widget</a>
+ </li>
+
+ <li >
+ <a href="486_1_1.html">Aggregatefield widget</a>
+ </li>
+
+ <li >
+ <a href="482_1_1.html">Booleanfield widget</a>
+ </li>
+
+ <li >
+ <a href="1161_1_1.html">Calculated fields</a>
+ </li>
+
+ <li >
+ <a href="1294_1_1.html">Captcha Widget</a>
+ </li>
+
+ <li >
+ <strong>Class/New (not really widgets)</strong>
+ </li>
+
+ <li >
+ <a href="481_1_1.html">Field widget</a>
+ </li>
+
+ <li >
+ <a href="754_1_1.html">Form</a>
+ </li>
+
+ <li >
+ <a href="740_1_1.html">Group/Struct widget</a>
+ </li>
+
+ <li >
+ <a href="738_1_1.html">ImageMap widget</a>
+ </li>
+
+ <li >
+ <a href="497_1_1.html">Messages widget</a>
+ </li>
+
+ <li >
+ <a href="490_1_1.html">MultiValueField widget</a>
+ </li>
+
+ <li >
+ <a href="492_1_1.html">Output widget</a>
+ </li>
+
+ <li >
+ <a href="494_1_1.html">RepeaterAction widget</a>
+ </li>
+
+ <li >
+ <a href="496_1_1.html">Repeater widget</a>
+ </li>
+
+ <li >
+ <a href="495_1_1.html">RowAction widget</a>
+ </li>
+
+ <li >
+ <a href="493_1_1.html">Submit widget</a>
+ </li>
+
+ <li >
+ <a href="739_1_1.html">Tree widget</a>
+ </li>
+
+ <li >
+ <a href="741_1_1.html">Union widget</a>
+ </li>
+
+ <li >
+ <a href="483_1_1.html">Upload widget</a>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="484_1_1.html">Widget concepts</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Form publishing</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="488_1_1.html">Binding</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="750_1_1.html">Ajax</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="904_1_1.html">Action</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="915_1_1.html">Generator</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">Class/New (not really widgets)</h1><p>See for now <a href="http://wiki.apache.org/cocoon/FormsClassWidget">here one
+the wiki</a>.</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/742?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>
Added: cocoon/site/site/2.2/blocks/forms/1.0/743_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/743_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/743_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/743_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,376 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="489_1_1.html">Basics</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="477_1_1.html">Widgets</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="484_1_1.html">Widget concepts</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Form publishing</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <a href="488_1_1.html">Binding</a>
+ <ul>
+
+ <li >
+ <a href="488_1_1.html">Binding Framework</a>
+ </li>
+
+ <li >
+ <strong>Simple XML Binding</strong>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="750_1_1.html">Ajax</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="904_1_1.html">Action</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="915_1_1.html">Generator</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">Simple XML Binding</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Concept</h1><p>As an alternative for the more flexible <a href="488_1_1.html">binding
+framework</a>, there is also a simpler solution that can be used when there is a
+1-to-1 coupling between the XML and the form.</p><p>The XML format is such that there is one XML element for each widget and the
+element gets the widget id as name. Exceptions from this are that the elements
+in a <a href="496_1_1.html">repeater</a> get the name "item" and an attribute
+"position" with the position of the repeater child, instead of just a number
+(which is not allowed as element name). Childs of a
+<a href="490_1_1.html">MultiValueField</a> are also embedded within an "item"
+element. If the Form widget does not have an id it gets the name "unknown".</p><p>An AggregateField can both be interpreted as one value and as several
+widgets. This ambiguity is resolved by choosing to emit the single value rather
+than the fields as XML. For population of the form both forms are however
+allowed.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Usage</h1><p>The simple XML binding is implemented by the following class:</p><pre>org.apache.cocoon.forms.util.XMLAdapter
+</pre><p>To load XML, you simply construct an XMLAdapter with a form instance as
+argument to the constructor. You can then load XML into the form simply by using
+the XMLAdapter as a ContentHandler for the XML parser, and save the XML by using
+the toSAX method on the XMLAdapter object.</p><p>In the flowscript CForm API, the form object has a <tt>getXML()</tt> method
+that returns an XMLAdapter instance. But more simply, there are also
+<tt>form.loadXML(uri)</tt> and <tt>form.saveXML(uri)</tt> methods.</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/743?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>
Added: cocoon/site/site/2.2/blocks/forms/1.0/750_1_1.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.2/blocks/forms/1.0/750_1_1.html?rev=580139&view=auto
==============================================================================
--- cocoon/site/site/2.2/blocks/forms/1.0/750_1_1.html (added)
+++ cocoon/site/site/2.2/blocks/forms/1.0/750_1_1.html Thu Sep 27 12:56:05 2007
@@ -0,0 +1,533 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title> Cocoon Forms
+ </title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="The Cocoon Community" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body>
+ <div id="breadtrail">
+ <p><a href="http://www.apache.org">Apache</a> » <a href="../../../../">Cocoon</a> »</p>
+ </div>
+ <div id="top">
+ <div id="header">
+ <div class="projectlogo">
+ <a href="../../../../"><img class="logoImage"
+ src="images/cocoon_logo.jpg"
+ alt="Apache Cocoon" border="0" /></a>
+ </div>
+ <div class="grouplogo">
+ <p class="grouptitle"><a href="../../../../">The Apache Cocoon Project</a><img
+ src="images/apache-logo.jpg" alt="Cocoon Project Logo" /></p>
+ <form class="searchbox" action="http://www.google.com/search" method="get">
+ <input value="cocoon.apache.org" name="sitesearch" type="hidden" />
+ <input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google" />
+ <input class="searchboxsubmit" name="Search" value="Search" type="submit" />
+ </form>
+ </div>
+ </div>
+ <div id="projectBar">
+ <p class="cocoonHome"><a href="../../../../"><img
+ src="images/pmc-home.gif"
+ alt="Back to Apache Cocoon homepage"
+ border="0" title="Back to Apache Cocoon homepage" /></a></p>
+ <h1 class="projectTitle"><a href="../../../../"> Cocoon Forms
+ 1.0
+ </a></h1>
+ <ul class="projectList">
+ <li><strong><a href="../../../../2.2/">Cocoon 2.2</a></em></strong></li>
+ <li><a href="../../../../2.2/core-modules/">Core <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/blocks/">Blocks <span class="pl-version-small">2.2</span></a></li>
+ <li><a href="../../../../2.2/maven-plugins/">Maven Plugins <span class="pl-version-small">2.2</span></a></li>
+ <li><strong><a href="../../../../subprojects/">Subprojects</a></strong></li>
+ </ul>
+ </div>
+ <div class="projectBarClear"><!-- --></div>
+ </div>
+<!-- end of top -->
+
+ <div id="content">
+ <ul id="menu">
+ <li>
+ Forms
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="489_1_1.html">Basics</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="477_1_1.html">Widgets</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="484_1_1.html">Widget concepts</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="755_1_1.html">Form publishing</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="488_1_1.html">Binding</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="498_1_1.html">API</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="685_1_1.html">Form libraries</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuExpand'>
+ <strong>Ajax</strong>
+ <ul>
+
+ <li >
+ <strong>Ajax</strong>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Migration guide
+ <ul>
+
+ <li >
+ <a href="1351_1_1.html">Migration guide</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Sitemap Components
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="904_1_1.html">Action</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="915_1_1.html">Generator</a>
+ </li>
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="994_1_1.html">Transformer</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ Project Documentation
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class='menuCollapse'>
+ <a href="project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+<!--
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
+ </a>
+ <div id="lastPublished">
+
+ Last Published: 26/09/2007 05:18
+ </div>
+-->
+ <div id="contentBody"><div id="bodyText"><h1 class="docTitle">Ajax</h1><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Introduction</h1><p><a href="http://en.wikipedia.org/wiki/AJAX">Ajax</a> is a catchy name for
+using JavaScript client-side code that communicates asynchronously with the
+server, thus allowing to escape the traditional web model where each button
+click translates to a full page reload.</p><p>Cocoon Forms has a number of features that allow the building of
+highly-interactive forms, such as validation, value-change listeners, intra-form
+actions, repeaters, etc. Having a full page reload for each action doesn't
+provide a good user experience and puts an unncessary load on the server.</p><p>Starting with Cocoon 2.1.8, Cocoon Forms offers (mostly) transparent Ajax
+support. What this means is that when a form is submitted, this happens in the
+background and only those parts of the form that actually changed are updated on
+the page. Full-page reload only happens when interaction with the form is
+finished.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">How to activate Ajax on your forms?</h1><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">The "ajax" attribute</h2><p>Activating Ajax mode on your forms is straightforward: just add
+<tt>ajax="true"</tt> on the <tt><ft:form-template></tt> element in your
+form template:</p><pre><ft:form-template action="continue" method="POST" <strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">ajax="true"</strong>>
+ <ft:widget id="email"/>
+ .../...
+</ft:form-template>
+</pre><p>There are a number of things to take care of though for the Ajax mode to
+function properly.</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Use the Template Generator</h2><p>As of version 2.1.8, Ajax support is implemented only in the JXTemplate
+version of the Forms Template language. This means that the form display
+pipeline must ust the JXTemplate generator and use jx-macros.xml:</p><pre><html xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+
+ <!-- Import the macros that define CForms template elements -->
+ <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
+ <body>
+ <ft:form-template action="continue" method="POST" ajax="true">
+ ...
+</pre><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Container widgets must enclose a container element</h2><p>The Ajax support of Cocoon Forms works by sending partial page updates to the
+browser. This requires the representation of widgets to be contained in a single
+element, which becomes the "replacement unit" for that widget.</p><p>The styling stylesheets take care of this for terminal widgets such as fields
+and actions, but not for container widgets whose layout are completely defined
+by the page template. Concretely, this means that <tt><ft:repeater></tt>,
+<tt><ft:group></tt> and <tt><ft:union</tt>> instructions must
+contain a single element such as HTML <tt><div></tt>,
+<tt><table></tt>, <tt><span></tt>, etc.</p><pre><ft:group id="info">
+ <div>
+ <p><ft:widget id="foo"/></p>
+ <p><ft:widget id="bar"/></p>
+ </div>
+</ft:group>
+</pre><p>The formatting pipeline with then take care of adding an <tt>id</tt>
+attribute on the container element so that it can be found and updated in the
+displayed page.</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Use <ft:repeater> instead of <ft:repeater-widget></h2><p>A problem with the existing <tt><ft:repeater-widget></tt> instruction
+is that it handles two different kinds of widgets, the repeater itself and its
+rows. This has the drawback of not allowing individual refresh of rows and does
+not allow the template system to identify a unique element that contains the
+repeater, as explained above.</p><p>Starting with Cocoon 2.1.8, the template for repeaters involve two
+instructions, <tt><ft:repeater></tt> and
+<tt><ft:repeater-rows></tt>:</p><ul>
+<li><tt><ft:repeater></tt> starts the repeater template, and sets the
+repeater as the context widget. This instruction must contain a single element.
+</li>
+<li><tt><ft:repeater-rows></tt> iterates through all rows in the repeater.
+Again, and because a row is a container widget, this instruction must contain a
+single element. Note that <tt><ft:repeater-rows></tt> has to be a
+descendant of <tt><ft:repeater></tt>, but does not need to be a direct
+child and that any number of document elements can enclose
+<tt><ft:repeater-rows></tt> (not form templates instruction though).</li>
+</ul>Remember also that the JXTemplate macros define the <tt>repeater</tt> and
+<tt>repeaterLoop</tt> variables in <tt><ft:repeater></tt> and
+<tt><ft:repeater-rows></tt> respectively that allow for some powerful
+conditional templates.Here's a complete example, which is what you will have in many real-world
+situations:<pre>Here are your contacts:
+
+<ft:repeater id="contacts">
+ <jx:choose>
+
+ <!-- formatting of an empty "contacts" -->
+ <jx:when test="${repeater.size == 0}">
+ <span>
+ You have no contacts.
+ <ft:widget id="../add-contact"/>
+ </span>
+ </jx:when>
+
+ <!-- formatting for a non-empty "contacts" -->
+ <jx:otherwise>
+ <div>
+ <table>
+ <tr>
+ <th>First name</th><th>Last name</th><th>Email</th>
+ </tr>
+ <ft:repeater-rows>
+ <!-- container element for rows -->
+ <tr class="row-${repeaterLoop.index % 2}">
+ <ft:widget id="firstname"/>
+ <ft:widget id="lastname"/>
+ <ft:widget id="email"/>
+ <ft:widget id="select"/>
+ </tr>
+ </ft:repeater-rows>
+ </table>
+ <ft:widget id="../add-contact"/>
+ <ft:widget id="../delete-contact"/>
+ </div>
+ </jx:otherwise>
+
+ </jx:choose>
+</ft:repeater>
+
+<ft:widget id="ok"/>
+</pre><p>This example shows some conditional formatting (using JXTemplate) depending
+if the repeater is empty or not. In the two cases, the action widgets that allow
+to remove and delete rows are added within the repeater template. We use the
+<tt>"../add-contact"</tt> notation (<tt>"../"</tt> goes back to the parent
+widget) as these actions are defined as siblings of the repeater in the form
+definition, but we want them to be included in the repeater's conditional
+templates. We therefore need to "escape" the repeater to lookup its siblings.
+</p><p>Notice the <tt><span></tt> element when the repeater is empty. Even it
+we don't really need it from the page layout point of view, it is required to
+have a single element for Ajax updates when the user adds a contact.</p><p>Notice also the <tt><div></tt> element when the repeater is not empty.
+We cannot use the <tt><table></tt> that encloses rows, as again, we want
+to include the <tt>"add-contact"</tt> and <tt>"delete-contacts"</tt> actions in
+the conditional template. We therefore need an enclosing element for the table
+and the actions.</p><p>The <tt><ft:repeater-rows></tt> doesn't need anything special as the
+<tt><td></tt> serves as the container. The
+<tt>class="row-${repeaterLoop.index % 2}"</tt> allows the generation of
+alternating colors of rows, as even rows will have <tt>class="row-0"</tt> and
+odd rows will have <tt>class="row-1"</tt>.</p><h2 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Using Ajax in portals and aggregations: the "ajax-action" attribute</h2><p>Portals do a lot of URL rewriting to ensure that only aggregated portal pages
+are displayed, even if individual portlets use their own URLs without caring
+about being integrating in a portal. This rewriting defeats the Ajax system that
+posts the form in the background using the <tt><form></tt>'s
+<tt>action</tt> attribute, which is rewritten by the portal.</p><p>To allow the Ajax system to function in a portal, you must add an additional
+<tt>ajax-action</tt> attribute on <tt><ft:form-template></tt>. When
+present, this attribute's value is where Ajax requests will be posted instead of
+the value of <tt>action</tt>.</p><pre><ft:form-template action="aggregation" ajax-action="continue-form">
+ .../...
+</ft:form-template></pre><p>Note that because of the portal's URL rewriting, the two attributes will
+often have the same values in the template.</p><p>The <tt>ajax-action</tt> attribute must also be used when the form page is
+produced by an aggregation (e.g. with <tt><map:aggregate></tt>): the
+form's <tt>action</tt> attribute will point to the full aggregation, which is
+not suitable to produce page update fragments. The <tt>ajax-action</tt>
+attribute must then point to the URL that handles for form and not to the full
+aggregation.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">The form display pipeline for Ajax</h1><p>Using Ajax in your forms requires a special pipeline: along with the regular
+form display pipeline, we need additional components that will filter the form
+when an Ajax request is processed, so that only partial page update instructions
+are sent to the browser, and not the full HTML page.</p><p>Here's a typical Ajax form display pipeline:</p><pre><map:match pattern="viewform-*">
+ <map:generate type="jx" src="pages/{1}.xml"/>
+<strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0"> <map:transform type="browser-update"/>
+</strong> <map:transform type="i18n"/>
+ <map:transform src="resources/forms-styling.xsl"/>
+ <map:transform type="i18n">
+<strong xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0"> <map:select type="ajax-request">
+ <map:when test="true">
+ <map:serialize type="xml"/>
+ </map:when>
+ <map:otherwise>
+ <map:serialize type="html"/>
+ </map:otherwise>
+ </map:select>
+</strong></map:match></pre><p>Things to notice in this pipeline:</p><ul>
+<li>the JXTemplate generator is used. Ajax is not yet implemented in the
+FormsTransformer</li>
+<li>the "browser-update" transformer filters the result of the template, so that
+only updated widgets are sent back to the browser</li>
+<li>the serializer depends on the request type: an Ajax requests <em>must</em>
+return XML, whereas non-Ajax requests can return HTML.</li>
+</ul>The additional components are declared as follows in the sitemap:<pre><map:components>
+ <map:transformers default="xslt">
+ <map:transformer name="browser-update" src="org.apache.cocoon.ajax.BrowserUpdateTransformer"/>
+ </map:transformers>
+ <map:selectors>
+ <map:selector name="ajax-request" src="org.apache.cocoon.ajax.AjaxRequestSelector"/>
+ </map:selectors>
+</map:components>
+</pre><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Debugging Ajax forms</h1>Debugging Ajax forms is less easy than regular forms with full page reloads,
+as some processing occurs in the background. When an error occurs in a
+background resquest, the client-side JavaScript library prompts the user to
+display the server response in a separate window. Popup windows must be allowed
+for the target server for this to function properly.Another invaluable tool is the little-know
+<a href="http://ws.apache.org/axis/java/user-guide.html#AppendixUsingTheAxisTCPMonitorTcpmon">TCP
+monitor</a> utility hidden inside Axis. This is a small Java application that
+acts as a HTTP tunnel or a proxy that sits inbetween the browser and the server,
+and records all requests and responses, which can then be examined.<p>Other useful tools are the classical TCP sniffers such as the Unix
+<a href="http://www.tcpdump.org/tcpdump_man.html">tcpdump</a> command or the
+<a href="http://www.ethereal.com/">Ethereal</a> tool. They are not easy to setup
+and master, though.</p><h1 xmlns:p="http://outerx.org/daisy/1.0#publisher" xmlns:ns="http://outerx.org/daisy/1.0">Additional information</h1><p>You can also find additional information in the
+<a href="http://www.cocoongt.org/Slides-and-recordings.html">Ajax presentation
+from the Cocoon GetTogether 2005</a>.</p></div><div class="editUrl"><div><em>Errors and Improvements?</em> If you see any errors or potential improvements in this document please help
+ us: <a href="http://cocoon.zones.apache.org/daisy/cdocs/750?branch=1&language=1">View, Edit or comment</a> on the latest development version (registration required).
+ </div></div></div>
+ </div>
+ <!-- end of content -->
+ <div id="footer">
+ <p>©
+ 1999-2007
+
+ The Apache Software Foundation
+ <br/>
+
+ Last Published: 26/09/2007 05:18
+</p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-1740622-3";
+ urchinTracker();
+ </script>
+ </body>
+</html>