home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / widget_submit.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  3.3 KB  |  79 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "document-v10.dtd">
  18.  
  19. <document>
  20.   <header>
  21.     <title>Cocoon Forms: submit widget</title>
  22.     <authors>
  23.       <person name="The Apache Cocoon Team" email="dev@cocoon.apache.org"/>
  24.     </authors>
  25.   </header>
  26.   <body>
  27.     <s1 title="Concept">
  28.       <p>The submit widget, usually rendered as a button, is used by
  29.       the user to submit the form. The submit widget is a special kind
  30.       of action widget, thus also has the same functionality as an action
  31.       widget, however the submit widget does trigger validation and its
  32.       purpose is to end the form.</p>
  33.  
  34.       <p>You don't need to use a submit widget to submit a form. For example,
  35.       in your HTML template you can simply put:</p>
  36.  
  37.       <source><![CDATA[<input type="submit"/>]]></source>
  38.  
  39.       <p>to be able to submit the form. Using a submit widget enables
  40.       some extra functionality. You can control whether validation
  41.       should be performed. You can put multiple submit widgets on
  42.       a form and add different event handlers to them.</p>
  43.  
  44.       <p>While a submit widget has the explicit purpose to submit a
  45.       form, a form can also be submitted by other widgets. One example
  46.       is the already mentioned <link href="widget_action.html">action
  47.       widget</link>. It is however also possible to automatically submit
  48.       a form when a widget changes its value, so that server-side event
  49.       value-changed event listeners can be triggerd. This can be specified
  50.       using <code><fi:styling submit-on-change="true"/></code> in
  51.       the form template (see <link href="xslt.html">XSLT</link> for more
  52.       information on the <code>fi:styling</code> directive).</p>
  53.  
  54.       <p>To know which widget caused the form to be submitted, use the
  55.       method <code>getSubmitWidget</code> of the <code>Form</code> object.</p>
  56.     </s1>
  57.  
  58.     <s1 title="Configuration">
  59.       <source><![CDATA[<fd:submit id="..." action-command="..." validate="true|false">
  60.   <fd:label>...</fd:label>
  61.   <fd:help>...</fd:help>
  62.   <fd:hint>...</fd:hint>
  63.   <fd:on-action>
  64.     ...
  65.   </fd:on-action>
  66. </fd:submit>]]></source>
  67.  
  68.       <p>The optional attribute validate, which is true by default, can
  69.       be used to disable validation. The difference between an action
  70.       widget and a submit widget with validate="false" is that a submit
  71.       widget with validate="false" will end form processing, thus the form
  72.       will not be redisplayed. Ultimately, it is of course the controller
  73.       who decides this, but the forms hint towards the controller is that
  74.       it shouldn't be redisplayed, and this is exactly what the flowscript
  75.       integration library does.</p>
  76.     </s1>
  77.   </body>
  78. </document>
  79.