Date: 2004-10-15T05:41:37
Editor: TimLarson <[EMAIL PROTECTED]>
Wiki: Cocoon Wiki
Page: WoodyWidgetReference
URL: http://wiki.apache.org/cocoon/WoodyWidgetReference
on-activate -> on-action for repeater-action and row-action
Change Log:
------------------------------------------------------------------------------
@@ -35,22 +35,22 @@
Configuration example:
-{{{
-<wd:field id="..." required="true|false">
- <wd:label>...</wd:label>
- <wd:hint>...</wd:hint>
- <wd:help>...</wd:help>
- <wd:datatype base="...">
- [...]
- </wd:datatype>
- <wd:selection-list .../>
- <wd:validation>
- [...]
- </wd:validation>
- <wd:on-value-changed>
- ...
- </wd:on-value-changed>
-</wd:field>
+{{{
+<wd:field id="..." required="true|false">
+ <wd:label>...</wd:label>
+ <wd:hint>...</wd:hint>
+ <wd:help>...</wd:help>
+ <wd:datatype base="...">
+ [...]
+ </wd:datatype>
+ <wd:selection-list .../>
+ <wd:validation>
+ [...]
+ </wd:validation>
+ <wd:on-value-changed>
+ ...
+ </wd:on-value-changed>
+</wd:field>
}}}
The field element takes a required '''id''' attribute. This id should be
unique among all widgets in the same container (usually the form).
@@ -80,21 +80,21 @@
Configuration example:
-{{{
-<wd:multivaluefield id="...">
- <wd:label>...</wd:label>
- <wd:help>...</wd:help>
- <wd:hint>...</wd:hint>
- <wd:datatype base="...">
- [...]
- </wd:datatype>
- <wd:selection-list>
- <wd:item value="...">
- <wd:label>...</wd:label>
- </wd:item>
- [...]
- </wd:selection-list>
-</wd:multivaluefield>
+{{{
+<wd:multivaluefield id="...">
+ <wd:label>...</wd:label>
+ <wd:help>...</wd:help>
+ <wd:hint>...</wd:hint>
+ <wd:datatype base="...">
+ [...]
+ </wd:datatype>
+ <wd:selection-list>
+ <wd:item value="...">
+ <wd:label>...</wd:label>
+ </wd:item>
+ [...]
+ </wd:selection-list>
+</wd:multivaluefield>
}}}
Most of the elements and attributes have the same meaning as for the
@@ -111,12 +111,12 @@
Configuration example:
-{{{
-<wd:booleanfield id="...">
- <wd:label>...</wd:label>
- <wd:help>...</wd:help>
- <wd:hint>...</wd:hint>
-</wd:booleanfield>
+{{{
+<wd:booleanfield id="...">
+ <wd:label>...</wd:label>
+ <wd:help>...</wd:help>
+ <wd:hint>...</wd:hint>
+</wd:booleanfield>
}}}
[[Anchor(4)]]
@@ -127,12 +127,12 @@
Configuration example:
-{{{
-<wd:repeater id="..." initial-size="...">
- <wd:widgets>
- [...]
- </wd:widgets>
-</wd:repeater>
+{{{
+<wd:repeater id="..." initial-size="...">
+ <wd:widgets>
+ [...]
+ </wd:widgets>
+</wd:repeater>
}}}
The '''wd:widgets''' element should contain a number of other widgets
@@ -147,15 +147,15 @@
== output widget ==
An '''wd:output''' widget is similar to a field widget, but its value is not
editable. The value of an output widget must be set programmatically (or
through WoodyBinding). An output widget does not read its value from the
request, so is most useful in the case where the form is stored accross
requests (e.g. as part of a flowscript or flow-apple). An output widget does
not perform any validation, it is always considered to be valid.
-{{{
-<wd:output id="...">
- <wd:label>...</wd:label>
- <wd:help>...</wd:help>
- <wd:hint>...</wd:hint>
- <wd:datatype base="...">
- [...]
- </wd:datatype>
-</wd:output>
+{{{
+<wd:output id="...">
+ <wd:label>...</wd:label>
+ <wd:help>...</wd:help>
+ <wd:hint>...</wd:hint>
+ <wd:datatype base="...">
+ [...]
+ </wd:datatype>
+</wd:output>
}}}
[[Anchor(6)]]
@@ -163,15 +163,15 @@
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
submit widget. After pressing an action button, the form will normally always
be redisplayed, unless the event handling code explicitely disables this (by
using the end!FormProcessing method on the form object).
-{{{
-<wd:action id="..." action-command="...">
- <wd:label>...</wd:label>
- <wd:help>...</wd:help>
- <wd:hint>...</wd:hint>
- <wd:on-action>
- ...
- </wd:on-action>
-</wd:action>
+{{{
+<wd:action id="..." action-command="...">
+ <wd:label>...</wd:label>
+ <wd:help>...</wd:help>
+ <wd:hint>...</wd:hint>
+ <wd:on-action>
+ ...
+ </wd:on-action>
+</wd:action>
}}}
The '''action-command''' 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 wd:action from another one.
@@ -182,15 +182,15 @@
== submit widget ==
The submit widget, usually rendered as a button, is used by the user to submit
the form. The submit widget is a special kind of action widget, thus also has
the same functionality as an action widget, however the submit widget does
trigger validation and its purpose is to end the form.
-{{{
-<wd:submit id="..." action-command="..." validate="true|false">
- <wd:label>...</wd:label>
- <wd:help>...</wd:help>
- <wd:hint>...</wd:hint>
- <wd:on-action>
- ...
- </wd:on-action>
-</wd:submit>
+{{{
+<wd:submit id="..." action-command="..." validate="true|false">
+ <wd:label>...</wd:label>
+ <wd:help>...</wd:help>
+ <wd:hint>...</wd:hint>
+ <wd:on-action>
+ ...
+ </wd:on-action>
+</wd:submit>
}}}
The optional attribute validate, which is true by default, can be used to
disable validation. The difference between an action widget and a submit widget
with validate="false" is that a submit widget with validate="false" will end
form processing, thus the form will not be redisplayed (ultimately, it is of
course the controller who decides this, but the forms hint towards the
controller is that it shouldn't be redisplayed, and this is exactly what the
flowscript integration library does).
@@ -200,15 +200,15 @@
This is a specific type of action widget that handles the much needed case of
adding or removing rows from a repeater.
-{{{
-<wd:repeater-action id="..." action-command="delete-rows|add-row"
repeater="..." select="...">
- <wd:label>...</wd:label>
- <wd:help>...</wd:help>
- <wd:hint>...</wd:hint>
- <wd:on-activate>
- ...
- </wd:on-activate>
-</wd:repeater-action>
+{{{
+<wd:repeater-action id="..." action-command="delete-rows|add-row"
repeater="..." select="...">
+ <wd:label>...</wd:label>
+ <wd:help>...</wd:help>
+ <wd:hint>...</wd:hint>
+ <wd:on-action>
+ ...
+ </wd:on-action>
+</wd:repeater-action>
}}}
The '''action-command''' attribute should have either the value
{{{delete-rows}}} or {{{add-row}}}. If {{{add-row}}} is specified, the
attribute repeater is required. If {{{delete-rows}}} is specified, both the
repeater and select attributes are required.
@@ -217,27 +217,27 @@
The '''select''' attribute should contain the id of the booleanfield widget
(or any type of widget who's getValue() method returns a boolean) that is part
of the repeater and used to mark the rows to be deleted.
-'''wd:on-activate''' allows additional event handlers to be defined, see also
WoodyEventHandling. The interface to be implemented for Java event listeners is
org.apache.cocoon.woody.event.!ActionListener. The !WidgetEvent subclass is
{{{org.apache.cocoon.woody.event.ActionEvent}}}.
+'''wd:on-action''' allows additional event handlers to be defined, see also
WoodyEventHandling. The interface to be implemented for Java event listeners is
org.apache.cocoon.woody.event.!ActionListener. The !WidgetEvent subclass is
{{{org.apache.cocoon.woody.event.ActionEvent}}}.
[[Anchor(9)]]
== row-action widget ==
This is a specific type of action widget that handles frequent actions
occuring on a repeater row, such as adding/removing a row and moving it up and
down. These widgets should be placed inside a repeater and act on the current
row.
-{{{
-<wd:row-action id="..." action-command="add-after|delete|move-up|move-down">
- <wd:label>...</wd:label>
- <wd:help>...</wd:help>
- <wd:hint>...</wd:hint>
- <wd:on-activate>
- ...
- </wd:on-activate>
-</wd:row-action>
+{{{
+<wd:row-action id="..." action-command="add-after|delete|move-up|move-down">
+ <wd:label>...</wd:label>
+ <wd:help>...</wd:help>
+ <wd:hint>...</wd:hint>
+ <wd:on-action>
+ ...
+ </wd:on-action>
+</wd:row-action>
}}}
The '''action-command''' attribute should have either the value
{{{add-after}}}, {{{delete}}}, {{{move-up}}} or {{{move-down}}}.
-'''wd:on-activate''' allows additional event handlers to be defined, see also
WoodyEventHandling. The interface to be implemented for Java event listeners is
org.apache.cocoon.woody.event.!ActionListener. The !WidgetEvent subclass is
{{{org.apache.cocoon.woody.event.ActionEvent}}}.
+'''wd:on-action''' allows additional event handlers to be defined, see also
WoodyEventHandling. The interface to be implemented for Java event listeners is
org.apache.cocoon.woody.event.!ActionListener. The !WidgetEvent subclass is
{{{org.apache.cocoon.woody.event.ActionEvent}}}.
Where all you want to do is submit a specific row on a repeater, simply add a
<wd:submit> element to the widgets for the repeater.
@@ -258,12 +258,12 @@
Also, don't forget to put the '''enctype''' attribute as
{{{multipart/form-data}}} in the '''wt:form-template''' element, inside the
template file.
-{{{
-<wd:upload id="..." mime-types="text/plain, text/xml" required="true|false">
- <wd:label>...</wd:label>
- <wd:help>...</wd:help>
- <wd:hint>...</wd:hint>
-</wd:upload>
+{{{
+<wd:upload id="..." mime-types="text/plain, text/xml" required="true|false">
+ <wd:label>...</wd:label>
+ <wd:help>...</wd:help>
+ <wd:hint>...</wd:hint>
+</wd:upload>
}}}
The optional {{{mime-types}}} attribute allows to specify a comma-separated
list of mime-types which are accepted. The widget will be invalid if the
uploaded type isn't of one of the specified content types.