blob: bde6554a7bfd121f0c0ea34ba37777411f12fef0 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cocoon Forms: action widget</title>
<link href="http://purl.org/DC/elements/1.0/" rel="schema.DC">
<meta content="The Apache Cocoon Team" name="DC.Creator">
</head>
<body>
<h1>Concept</h1>
<p>Used to trigger an action event on the server side. Usually presented
as a button the user can press (though this is not required). When an
action widget was activated, validation will not be performed. This
is because usually it would be strange to have other fields validated
when the user's intention wasn't really to submit the form. If you want
validation to happen, use the <a href="widget_submit.html">submit widget</a>.
After pressing an action
button, the form will normally always be redisplayed, unless the event
handling code explicitely disables this (by using the method <span class="codefrag">endFormProcessing</span>
method on the <span class="codefrag">Form</span> object).</p>
<h1>Configuration</h1>
<pre class="code">&lt;fd:action id="..." action-command="..."&gt;
&lt;fd:label&gt;...&lt;/fd:label&gt;
&lt;fd:help&gt;...&lt;/fd:help&gt;
&lt;fd:hint&gt;...&lt;/fd:hint&gt;
&lt;fd:on-action&gt;
...
&lt;/fd:on-action&gt;
&lt;/fd:action&gt;</pre>
<p>The <strong>action-command</strong> attribute specifies a name
that will be part of the event generated by this widget. It can be
used to distinguish events originated from this fd:action from another one.</p>
<p>For more information on how event handlers are defined, see
<a href="eventhandling.html">Event Handling</a>. The interface
to be implemented for Java event listeners is
<span class="codefrag">org.apache.cocoon.forms.event.ActionListener</span>.
The WidgetEvent subclass is <span class="codefrag">org.apache.cocoon.forms.event.ActionEvent</span>.</p>
</body>
</html>