cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] WoodySample WoodyWidgetReference Sun Nov 2 06:00:04 2003
Date Sun, 02 Nov 2003 05:00:05 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=WoodySample , version: 18 on Sun Nov  2 04:02:45
2003 by AntonioGallardo

- The children of the __<wd:form>__ element identify widgets. As you can see, most of
the widgets are __field__ widgets. The __field__ widget is the most important widget in Woody,
so lets look at it in a bit more detail.
+ The children of the __<wd:form>__ element identify widgets. The widgets are defined
inside a __<wd:widgets>__ element. As you can see, most of the widgets are __field__
widgets. The __field__ widget is the most important widget in Woody, so lets look at it in
a bit more detail.
?                                                           +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Page: http://wiki.cocoondev.org/Wiki.jsp?page=WoodyWidgetReference , version: 4 on Sun Nov
 2 04:29:38 2003 by AntonioGallardo

- The field element takes a required __id attribute__. This id should be unique among all
widgets in the same container (usually the form).
?                                                  --

+ The field element takes a required __id__ attribute. This id should be unique among all
widgets in the same container (usually the form).
?                                        ++

- The __required attribute__ is optional, by default it is false. It indicates whether this
field is required.
?                         --

+ The __required__ attribute is optional, by default it is {{false}}. It indicates whether
this field is required.
?               ++                                         ++     ++

- The __wd:selection-list__ element is used to associate a selection list with this field.
See [here|WoodyDatatypeReference] for more details.
?                                                                                        
      -----

+ The __wd:selection-list__ element is used to associate a selection list with this field.
See [Woody Datatype Reference] for more details.
?                                                                                        
           +        +

- The __wd:on-value-changed__ element specifies event handlers to be executed in case the
value of this field changes. See also [WoodyEventHandling]. The interface to be implemented
for Java event listeners is ''org.apache.cocoon.woody.event.ValueChangedListener''. The WidgetEvent
subclass is ''org.apache.cocoon.woody.event.ValueChangedEvent''.
?                                                                                        
                                                                                         
                              ^^                                                  ^^     
                        ^^                                               ^^

+ The __wd:on-value-changed__ element specifies event handlers to be executed in case the
value of this field changes. See also [Woody Event Handling]. The interface to be implemented
for Java event listeners is {{org.apache.cocoon.woody.event.ValueChangedListener}}. The WidgetEvent
subclass is {{org.apache.cocoon.woody.event.ValueChangedEvent}}.
?                                                                                        
                                            +     +                                      
                                ^^                                                  ^^   
                          ^^                                               ^^

- __Note__: value-changed-events require that the form instance is stored serverside (because
otherwise Woody doesn't know what the previous values of the fields were). This is automatically
the case when you use flowscript. If you don't use flowscript you could store the form instance
in e.g. the session.
?                        ^^^^^^^

+ __Note__: ''Events used in {{<wd:on-value-changed>}} require that the form instance
is stored serverside (because otherwise Woody doesn't know what the previous values of the
fields were). This is automatically the case when you use flowscript. If you don't use flowscript
you could store the form instance in e.g. the session.''
?           ++++++++++++++++++++++++++             ^^^                                   
                                                                                         
                                                                                         
                                                           ++

- The __wd:multivaluefield__ is similar to the field widget but can take multiple values.
A multivaluefield should always have a __wd:datatype__ element combined with a __wd:selection-list__,
since the user will have to select values from this list. This the wd:multivaluefield could
be rendered as a list of checkboxes or as a listbox in which the user can select multiple
items.
?                                                                                        
                                                                                         
                                                                        -----

+ The __wd:multivaluefield__ is similar to the field widget but can take multiple values.
A multivaluefield should always have a __wd:datatype__ element combined with a __wd:selection-list__,
since the user will have to select values from this list. The wd:multivaluefield could be
rendered as a list of checkboxes or as a listbox in which the user can select multiple items.
- A multivaluefield cannot have a required attribute, instead you should
+ __Note__: ''A multivaluefield cannot have a {{required}} attribute, instead you should
? ++++++++++++                                ++        ++

- use the "value-count" validation rule to check the number of values
?         ^           ^

+ use the {{value-count}} validation rule to check the number of values
?         ^^           ^^

- the user has selected.
+ the user has selected.''
?                       ++

- It can be used to create e.g. tables.
+ It can be used to create e.g. tables, subforms, etc.
?                                     +++++++++++++++

- The wd:widgets element should contain a number of other widgets
+ The __wd:widgets__ element should contain a number of other widgets
?     ++          ++

- Note: the [WoodyTemplateTransformer] has specific support for specifying a template to use
to render each of the rows of a repeater widget. See the "Form1" example of Woody for an example
on how to use this.
?       ^                                                                                
                                                                    ^^

+ __Note__: ''The [Woody Template Transformer] has specific support for specifying a template
to use to render each of the rows of a repeater widget. See the "Form1" sample of Woody for
an example on how to use this.''
? ++    ++  ^^^         +        +                                                       
                                                                            ^            
                                    ++

- 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.
+ 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.
?     ++              ++

- For more information on how event handlers are defined, see [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''.
?                                                                                        
                                                      ^^                                 
          ^^                              ^^                                         ^^

+ For more information on how event handlers are defined, see [Woody Event Handling]. 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}}.
?                                                                   +     +              
                                                        ^^                               
            ^^                              ^^                                         ^^

- The action-command attribute should have either the value "delete-rows" or "add-row".
+ 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.
- If add-row is specified, the attribute repeater is required. If delete-rows is specified,
both the repeater and select attributes are required.
+ The __repeater__ attribute should contain the id of the repeater widget on which this repeater-action
should act.
- The repeater attribute should contain the id of the repeater widget on which this repeater-action
should act.
+ 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.
- 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-activate__ allows additional event handlers to be defined, see also [Woody Event
Handling]. 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}}.
? ++              ++                                                                +    
+                                                                                        
                                                        ^^                               
         ^^




Mime
View raw message