cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] WoodyScratchpad BeginnerDefaultContext Tue Feb 10 17:00:04 2004
Date Tue, 10 Feb 2004 16:00:05 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=WoodyScratchpad , version: 5 on Tue Feb 10 15:50:07
2004 by TimLarson

+ Please add comments, clarify wording, contribute ideas, etc.
+ 
- (These ideas are here for discussion; they have not been implemented yet.)
? -                                   ^ ^^^^                               -

+ These ideas are here for discussion, and have not been implemented yet.
?                                    ^ ^^^

- Note: The "expr" can only be an attribute on either the wd:choice or the wd:case's, but
not both.
+ The following structure supports dynamic (runtime) widget selection and lazy (a.k.a. on-demand)
widget creation based on a static form definition.
+ 
+ !Two (mutually exclusive) versions are available:
+ *Single string-valued expression selects a case (almost like a switch statement in the 'C'
language).
+ *Boolean-valued expression on each case (like a chain of if...else if...else if...else).
+ 
+ !Single string-valued expression selects a case:
+ 
+ Semantics:
+ The expression is evaluated to produce a string matching
+ one of the case id's.  The widgets referenced or contained by this
+ selected case are created if they do not yet exist.
+ 
+ Questions:
+ *Should we introduce a <wd:default/> case instead of indicating the default case by
way of a case with an empty "id" attribute?
+ *How should we indicate when we do not want to allow a default case?  Should we use 'required="true"'
or the lack of a <wd:default/> element to indicate this?
+ 
+ Comments:
+ Please add some comments.
+ Syntax:
+ <wd:choice expr="some-string-valued-expression-producing-a-case-id">
+   <!-- Zero or more widget definitions -->
- <wd:choice expr="some-expression">
- 
-   <!-- Place list of widget definitions here -->
- 
-   <wd:case id="some-case-id" expr="some-expression">
-     <!-- list of inline widget definitions and/or references to the widgets defined above
-->
+   <wd:case id="some-case-id">
+     <!-- list of inline widget definitions and/or
+          references to the widgets defined above -->
-   <!-- Optionally, a default case can be given like this: -->
-   <wd:case id="case-3" expr="true">
-     <!-- list of inline widget definitions and/or references to the widgets defined above
-->
+   <!-- Optional default case specified by empty "id" attribute: -->
+   <wd:case id="">
+     <!-- list of inline widget definitions and/or
+          references to the widgets defined above -->
+ Example:
+   <wd:field id="field-A".../>
+   <wd:repeater id="repeater-B" .../>
+   <wd:case id="case-0">
+     <wd:ref id="field-A"/>
+   </wd:case>
+   <wd:case id="case-1">
+     <wd:ref id="field-A"/>
+     <wd:ref id="repeater-A"/>
+   </wd:case>
+   <wd:case id="case-2">
+     <wd:booleanfield id="bool-C".../>
+   </wd:case>
+   <wd:case id="">
+     <wd:ref id="field-A"/>
+     <wd:field id="field-B".../>
+   </wd:case>
+ </wd:choice>
+ }}}
+ 
+ !Expression on each case:
+ 
+ Semantics: The case expressions are evaluated in sequence.
+ The first case with an expression that evaluates to true is selected,
+ expression evaluation stops, the widgets referenced or contained by
+ the selected case are created if they do not yet exist.
+ 
+ Questions:
+ Pretty much the same questions as above.
+ 
+ Comments:
+ Please add some comments.
+ 
+ {{{
+ <wd:choice id="some-id">
+   <!-- Zero or more widget definitions -->
+   <!-- One or more cases -->
+   <wd:case id="some-case-id" expr="some-boolean-valued-expression>
+     <!-- list of inline widget definitions and/or
+          references to the widgets defined above -->
+   </wd:case>
+   <!-- Optionally, a default case can be given like this: -->
+   <wd:case id="another-case-id" expr="some-boolean-valued-expression-that-equals-true">
+     <!-- list of inline widget definitions and/or
+          references to the widgets defined above -->
+   </wd:case>
+ </wd:choice>
+ 
+ <wd:choice id="some-id">


Page: http://wiki.cocoondev.org/Wiki.jsp?page=BeginnerDefaultContext , version: 10 on Tue
Feb 10 15:09:22 2004 by 216.1.16.126

+ *Hi Dave!



Mime
View raw message