cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r158090 - cocoon/blocks/core/forms/trunk/samples/swan/flow cocoon/blocks/core/forms/trunk/samples/swan/forms
Date Fri, 18 Mar 2005 16:34:38 GMT
Author: tim
Date: Fri Mar 18 08:34:35 2005
New Revision: 158090

URL: http://svn.apache.org/viewcvs?view=rev&rev=158090
Log:
Change from using setters to using '='.
Change from binding view-selector state to
statically settting state to invisible.

Modified:
    cocoon/blocks/core/forms/trunk/samples/swan/flow/swan.js
    cocoon/blocks/core/forms/trunk/samples/swan/forms/binding_binding.xml
    cocoon/blocks/core/forms/trunk/samples/swan/forms/binding_model.xml
    cocoon/blocks/core/forms/trunk/samples/swan/forms/model_binding.xml
    cocoon/blocks/core/forms/trunk/samples/swan/forms/model_model.xml
    cocoon/blocks/core/forms/trunk/samples/swan/forms/sitemap_binding.xml
    cocoon/blocks/core/forms/trunk/samples/swan/forms/sitemap_model.xml
    cocoon/blocks/core/forms/trunk/samples/swan/forms/template_binding.xml
    cocoon/blocks/core/forms/trunk/samples/swan/forms/template_model.xml
    cocoon/blocks/core/forms/trunk/samples/swan/forms/xreport_binding.xml
    cocoon/blocks/core/forms/trunk/samples/swan/forms/xreport_model.xml

Modified: cocoon/blocks/core/forms/trunk/samples/swan/flow/swan.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/flow/swan.js?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/flow/swan.js (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/flow/swan.js Fri Mar 18 08:34:35 2005
@@ -18,6 +18,8 @@
 * @version $Id$
 */
 
+  importPackage(org.apache.cocoon.forms.formmodel);
+
 cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
 
 function binding_gui(form) {

Modified: cocoon/blocks/core/forms/trunk/samples/swan/forms/binding_binding.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/forms/binding_binding.xml?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/forms/binding_binding.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/forms/binding_binding.xml Fri Mar 18 08:34:35
2005
@@ -195,9 +195,7 @@
   <fb:class id="view-selector-class">
     <fb:javascript id="view-selector" path="." direction="load">
       <fb:load-form>
-        widget.setValue("edit");
-        // View is selected by buttons.
-        widget.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+        widget.value = "edit";
       </fb:load-form>
     </fb:javascript>
   </fb:class>
@@ -214,7 +212,7 @@
   <fb:class id="item-row-class">
     <fb:javascript id="type-selector" path="." direction="load">
       <fb:load-form>
-        widget.setValue(jxpathPointer.getNode().getFirstChild().getLocalName());
+        widget.value = jxpathPointer.getNode().getFirstChild().getLocalName();
       </fb:load-form>
     </fb:javascript>
     <fb:union id="union" path=".">

Modified: cocoon/blocks/core/forms/trunk/samples/swan/forms/binding_model.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/forms/binding_model.xml?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/forms/binding_model.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/forms/binding_model.xml Fri Mar 18 08:34:35
2005
@@ -24,6 +24,7 @@
 <fd:form
   xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+
   <fd:widgets>
 
     <fd:messages id="messages"/>
@@ -45,9 +46,7 @@
             <javascript>
               var repeater = event.getSourceWidget().lookupWidget("../items");
               var view = repeater.getRow(repeater.getSize() - 1).getChild("view-selector");
-              view.setValue("edit");
-              // View is selected by buttons.
-              view.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:repeater-action>
@@ -56,7 +55,7 @@
 
     <fd:class id="view-selector-class">
       <fd:widgets>
-        <fd:field id="view-selector">
+        <fd:field id="view-selector" state="invisible">
           <fd:label>View</fd:label>
           <fd:datatype base="string"/>
           <fd:selection-list>
@@ -71,20 +70,20 @@
               var type = widget.lookupWidget("../type-selector");
               var stuff = union.lookupWidget(union.getValue() + "/stuff");
               if("edit".equals(widget.getValue())) {
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                union.state = WidgetState.ACTIVE;
                 if(stuff != null) {
-                  stuff.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                  stuff.state = WidgetState.ACTIVE;
                 }
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                type.state = WidgetState.ACTIVE;
               } else if("view".equals(widget.getValue())){
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                union.state = WidgetState.ACTIVE;
                 if(stuff != null) {
-                  stuff.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                  stuff.state = WidgetState.DISABLED;
                 }
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
-              } else {
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                type.state = WidgetState.DISABLED;
+              } else { // "fold"
+                union.state = WidgetState.DISABLED;
+                type.state = WidgetState.DISABLED;
               }
             </javascript>
           </fd:on-value-changed>
@@ -95,7 +94,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="fold";
+              view.value = "fold";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -105,7 +104,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="view";
+              view.value = "view";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -115,7 +114,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="edit";
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -167,13 +166,11 @@
           <fd:hint>Add after</fd:hint>
           <fd:on-action>
             <javascript>
-              var cur_row = Packages.org.apache.cocoon.forms.formmodel.Repeater.getParentRow(event.getSourceWidget());
+              var cur_row = Repeater.getParentRow(event.getSourceWidget());
               var repeater = cur_row.getParent();
               var new_row = repeater.getChild(repeater.indexOf(cur_row)+1);
               var view = new_row.getChild("view-selector");
-              view.setValue("edit");
-              // View is selected by buttons.
-              view.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:row-action>
@@ -462,4 +459,5 @@
     </fd:class>
 
   </fd:widgets>
+
 </fd:form>

Modified: cocoon/blocks/core/forms/trunk/samples/swan/forms/model_binding.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/forms/model_binding.xml?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/forms/model_binding.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/forms/model_binding.xml Fri Mar 18 08:34:35
2005
@@ -230,9 +230,7 @@
   <fb:class id="view-selector-class">
     <fb:javascript id="view-selector" path="." direction="load">
       <fb:load-form>
-        widget.setValue("view");
-        // View is selected by buttons.
-        widget.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+        widget.value = "view";
       </fb:load-form>
     </fb:javascript>
   </fb:class>
@@ -249,8 +247,7 @@
   <fb:class id="item-row-class">
     <fb:javascript id="type-selector" path="." direction="load">
       <fb:load-form>
-        var node = jxpathPointer.getNode().getFirstChild();
-        widget.setValue(node.getLocalName());
+        widget.value = jxpathPointer.getNode().getFirstChild().getLocalName();
       </fb:load-form>
     </fb:javascript>
     <fb:union id="union" path=".">

Modified: cocoon/blocks/core/forms/trunk/samples/swan/forms/model_model.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/forms/model_model.xml?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/forms/model_model.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/forms/model_model.xml Fri Mar 18 08:34:35
2005
@@ -45,9 +45,7 @@
             <javascript>
               var repeater = event.getSourceWidget().lookupWidget("../items");
               var view = repeater.getRow(repeater.getSize() - 1).getChild("view-selector");
-              view.setValue("edit");
-              // View is selected by buttons.
-              view.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:repeater-action>
@@ -56,7 +54,7 @@
 
     <fd:class id="view-selector-class">
       <fd:widgets>
-        <fd:field id="view-selector">
+        <fd:field id="view-selector" state="invisible">
           <fd:label>View</fd:label>
           <fd:datatype base="string"/>
           <fd:selection-list>
@@ -71,20 +69,20 @@
               var type = widget.lookupWidget("../type-selector");
               var stuff = union.lookupWidget(union.getValue() + "/stuff");
               if("edit".equals(widget.getValue())) {
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                union.state = WidgetState.ACTIVE;
                 if(stuff != null) {
-                  stuff.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                  stuff.state = WidgetState.ACTIVE;
                 }
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                type.state = WidgetState.ACTIVE;
               } else if("view".equals(widget.getValue())){
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                union.state = WidgetState.ACTIVE;
                 if(stuff != null) {
-                  stuff.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                  stuff.state = WidgetState.DISABLED;
                 }
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                type.state = WidgetState.DISABLED;
               } else {
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                union.state = WidgetState.DISABLED;
+                type.state = WidgetState.DISABLED;
               }
             </javascript>
           </fd:on-value-changed>
@@ -95,7 +93,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="fold";
+              view.value = "fold";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -105,7 +103,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="view";
+              view.value = "view";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -115,7 +113,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="edit";
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -165,13 +163,11 @@
           <fd:hint>Add after</fd:hint>
           <fd:on-action>
             <javascript>
-              var cur_row = Packages.org.apache.cocoon.forms.formmodel.Repeater.getParentRow(event.getSourceWidget());
+              var cur_row = Repeater.getParentRow(event.getSourceWidget());
               var repeater = cur_row.getParent();
               var new_row = repeater.getChild(repeater.indexOf(cur_row)+1);
               var view = new_row.getChild("view-selector");
-              view.setValue("edit");
-              // View is selected by buttons.
-              view.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:row-action>

Modified: cocoon/blocks/core/forms/trunk/samples/swan/forms/sitemap_binding.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/forms/sitemap_binding.xml?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/forms/sitemap_binding.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/forms/sitemap_binding.xml Fri Mar 18 08:34:35
2005
@@ -206,9 +206,7 @@
   <fb:class id="view-selector-class">
     <fb:javascript id="view-selector" path="." direction="load">
       <fb:load-form>
-        widget.setValue("view");
-        // View is selected by buttons.
-        widget.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+        widget.value = "view";
       </fb:load-form>
     </fb:javascript>
   </fb:class>
@@ -225,7 +223,7 @@
   <fb:class id="item-row-class">
     <fb:javascript id="type-selector" path="." direction="load">
       <fb:load-form>
-        widget.setValue(jxpathPointer.getNode().getFirstChild().getLocalName());
+        widget.value = jxpathPointer.getNode().getFirstChild().getLocalName();
       </fb:load-form>
     </fb:javascript>
     <fb:union id="union" path=".">

Modified: cocoon/blocks/core/forms/trunk/samples/swan/forms/sitemap_model.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/forms/sitemap_model.xml?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/forms/sitemap_model.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/forms/sitemap_model.xml Fri Mar 18 08:34:35
2005
@@ -45,9 +45,7 @@
             <javascript>
               var repeater = event.getSourceWidget().lookupWidget("../items");
               var view = repeater.getRow(repeater.getSize() - 1).getChild("view-selector");
-              view.setValue("edit");
-              // View is selected by buttons.
-              view.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:repeater-action>
@@ -56,7 +54,7 @@
 
     <fd:class id="view-selector-class">
       <fd:widgets>
-        <fd:field id="view-selector">
+        <fd:field id="view-selector" state="invisible">
           <fd:label>View</fd:label>
           <fd:datatype base="string"/>
           <fd:selection-list>
@@ -71,20 +69,20 @@
               var type = widget.lookupWidget("../type-selector");
               var stuff = union.lookupWidget(union.getValue() + "/stuff");
               if("edit".equals(widget.getValue())) {
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                union.state = WidgetState.ACTIVE;
                 if(stuff != null) {
-                  stuff.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                  stuff.state = WidgetState.ACTIVE;
                 }
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                type.state = WidgetState.ACTIVE;
               } else if("view".equals(widget.getValue())){
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                union.state = WidgetState.ACTIVE;
                 if(stuff != null) {
-                  stuff.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                  stuff.state = WidgetState.DISABLED;
                 }
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                type.state = WidgetState.DISABLED;
               } else {
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                union.state = WidgetState.DISABLED;
+                type.state = WidgetState.DISABLED;
               }
             </javascript>
           </fd:on-value-changed>
@@ -95,7 +93,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="fold";
+              view.value = "fold";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -105,7 +103,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="view";
+              view.value = "view";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -115,7 +113,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="edit";
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -166,13 +164,11 @@
           <fd:hint>Add after</fd:hint>
           <fd:on-action>
             <javascript>
-              var cur_row = Packages.org.apache.cocoon.forms.formmodel.Repeater.getParentRow(event.getSourceWidget());
+              var cur_row = Repeater.getParentRow(event.getSourceWidget());
               var repeater = cur_row.getParent();
               var new_row = repeater.getChild(repeater.indexOf(cur_row)+1);
               var view = new_row.getChild("view-selector");
-              view.setValue("edit");
-              // View is selected by buttons.
-              view.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:row-action>

Modified: cocoon/blocks/core/forms/trunk/samples/swan/forms/template_binding.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/forms/template_binding.xml?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/forms/template_binding.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/forms/template_binding.xml Fri Mar 18 08:34:35
2005
@@ -256,9 +256,7 @@
   <fb:class id="view-selector-class">
     <fb:javascript id="view-selector" path="." direction="load">
       <fb:load-form>
-        widget.setValue("view");
-        // View is selected by buttons.
-        widget.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+        widget.value = "view";
       </fb:load-form>
     </fb:javascript>
   </fb:class>
@@ -275,8 +273,7 @@
   <fb:class id="item-row-class">
     <fb:javascript id="type-selector" path="." direction="load">
       <fb:load-form>
-        var node = jxpathPointer.getNode().getFirstChild();
-        widget.setValue(node.getLocalName());
+        widget.value = jxpathPointer.getNode().getFirstChild().getLocalName();
       </fb:load-form>
     </fb:javascript>
     <fb:union id="union" path=".">

Modified: cocoon/blocks/core/forms/trunk/samples/swan/forms/template_model.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/forms/template_model.xml?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/forms/template_model.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/forms/template_model.xml Fri Mar 18 08:34:35
2005
@@ -45,9 +45,7 @@
             <javascript>
               var repeater = event.getSourceWidget().lookupWidget("../items");
               var view = repeater.getRow(repeater.getSize() - 1).getChild("view-selector");
-              view.setValue("edit");
-              // View is selected by buttons.
-              view.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:repeater-action>
@@ -56,7 +54,7 @@
 
     <fd:class id="view-selector-class">
       <fd:widgets>
-        <fd:field id="view-selector">
+        <fd:field id="view-selector" state="invisible">
           <fd:label>View</fd:label>
           <fd:datatype base="string"/>
           <fd:selection-list>
@@ -71,20 +69,20 @@
               var type = widget.lookupWidget("../type-selector");
               var stuff = union.lookupWidget(union.getValue() + "/stuff");
               if("edit".equals(widget.getValue())) {
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                union.state = WidgetState.ACTIVE;
                 if(stuff != null) {
-                  stuff.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                  stuff.state = WidgetState.ACTIVE;
                 }
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                type.state = WidgetState.ACTIVE;
               } else if("view".equals(widget.getValue())){
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                union.state = WidgetState.ACTIVE;
                 if(stuff != null) {
-                  stuff.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                  stuff.state = WidgetState.DISABLED;
                 }
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                type.state = WidgetState.DISABLED;
               } else {
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                union.state = WidgetState.DISABLED;
+                type.state = WidgetState.DISABLED;
               }
             </javascript>
           </fd:on-value-changed>
@@ -95,7 +93,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="fold";
+              view.value = "fold";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -105,7 +103,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="view";
+              view.value = "view";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -115,7 +113,7 @@
           <fd:on-action>
             <javascript>
               var view = event.getSourceWidget().lookupWidget("../view-selector");
-              view.value="edit";
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:action>
@@ -173,13 +171,11 @@
           <fd:hint>Add after</fd:hint>
           <fd:on-action>
             <javascript>
-              var cur_row = Packages.org.apache.cocoon.forms.formmodel.Repeater.getParentRow(event.getSourceWidget());
+              var cur_row = Repeater.getParentRow(event.getSourceWidget());
               var repeater = cur_row.getParent();
               var new_row = repeater.getChild(repeater.indexOf(cur_row)+1);
               var view = new_row.getChild("view-selector");
-              view.setValue("edit");
-              // View is selected by buttons.
-              view.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+              view.value = "edit";
             </javascript>
           </fd:on-action>
         </fd:row-action>

Modified: cocoon/blocks/core/forms/trunk/samples/swan/forms/xreport_binding.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/forms/xreport_binding.xml?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/forms/xreport_binding.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/forms/xreport_binding.xml Fri Mar 18 08:34:35
2005
@@ -70,7 +70,7 @@
       <fb:on-bind>
         <fb:javascript id="sql-type-selector" path="." direction="load">
           <fb:load-form>
-            widget.setValue(jxpathPointer.getNode().getFirstChild().getLocalName());
+            widget.value = jxpathPointer.getNode().getFirstChild().getLocalName();
           </fb:load-form>
         </fb:javascript>
         <fb:union id="type" path=".">
@@ -163,7 +163,7 @@
   <fb:class id="view-selector-class">
     <fb:javascript id="view-selector" path="." direction="load">
       <fb:load-form>
-        widget.setValue("edit");
+        widget.value = "edit";
       </fb:load-form>
     </fb:javascript>
   </fb:class>

Modified: cocoon/blocks/core/forms/trunk/samples/swan/forms/xreport_model.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/swan/forms/xreport_model.xml?view=diff&r1=158089&r2=158090
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/swan/forms/xreport_model.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/swan/forms/xreport_model.xml Fri Mar 18 08:34:35
2005
@@ -65,7 +65,7 @@
 
     <fd:class id="view-selector-class">
       <fd:widgets>
-        <fd:field id="view-selector">
+        <fd:field id="view-selector" state="invisible">
           <fd:label>View</fd:label>
           <fd:datatype base="string"/>
           <fd:selection-list>
@@ -82,11 +82,11 @@
               var union = widget.lookupWidget("../union");
               var type = widget.lookupWidget("../type-selector");
               if(widget.getValue().equals("edit")) {
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
+                union.state = WidgetState.ACTIVE;
+                type.state = WidgetState.ACTIVE;
               } else {
-                union.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
-                type.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
+                union.state = WidgetState.DISABLED;
+                type.state = WidgetState.DISABLED;
               }
             </javascript>
           </fd:on-value-changed>



Mime
View raw message