[Laszlo-checkins] r11095 - in openlaszlo/trunk: WEB-INF/lps/schema demos/vacation-survey examples/components laszlo-explorer/basics lps/components/base lps/components/lz

bargull@openlaszlo.org bargull at openlaszlo.org
Fri Sep 19 03:57:42 PDT 2008


Author: bargull
Date: 2008-09-19 03:57:33 -0700 (Fri, 19 Sep 2008)
New Revision: 11095

Modified:
   openlaszlo/trunk/WEB-INF/lps/schema/lfc.lzx
   openlaszlo/trunk/demos/vacation-survey/vacation-survey.lzx
   openlaszlo/trunk/examples/components/form_example.lzx
   openlaszlo/trunk/laszlo-explorer/basics/form.lzx
   openlaszlo/trunk/lps/components/base/submit.lzx
   openlaszlo/trunk/lps/components/lz/form.lzx
Log:
Change 20080918-bargull-ezt by bargull at dell--p4--2-53 on 2008-09-18 22:16:37
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: lz.submit compiler error for swf9

New Features:

Bugs Fixed: LPP-7006

Technical Reviewer: jcrowley
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
adjusted schema, the setter for "data" now lives on LzNode
changed submit#data to submit#dataset to avoid conflict with LzNode#data
Still set "data" to maintain bwcomp for the next release, but print a deprecated warning (which is bogus if you want to use LzNode#data...)
Updated example code in lz.form
Required for example code:
skip-pre-commit-checks 


    

Tests:



Modified: openlaszlo/trunk/WEB-INF/lps/schema/lfc.lzx
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/schema/lfc.lzx	2008-09-19 08:00:14 UTC (rev 11094)
+++ openlaszlo/trunk/WEB-INF/lps/schema/lfc.lzx	2008-09-19 10:57:33 UTC (rev 11095)
@@ -165,6 +165,7 @@
   <method name="$lzc$set_$datapath"/>
   <method name="$lzc$set_$delegates"/>
   <method name="$lzc$set_$refs"/>
+  <method name="$lzc$set_data"/>
   <method name="$lzc$set_datapath"/>
   <method name="$lzc$set_id"/>
   <method name="$lzc$set_name"/>
@@ -775,7 +776,6 @@
   </containsElements>
 
   <method name="$lzc$set_autorequest"/>
-  <method name="$lzc$set_data"/>
   <method name="$lzc$set_initialdata"/>
   <method name="$lzc$set_name"/>
   <method name="$lzc$set_querytype"/>

Modified: openlaszlo/trunk/demos/vacation-survey/vacation-survey.lzx
===================================================================
--- openlaszlo/trunk/demos/vacation-survey/vacation-survey.lzx	2008-09-19 08:00:14 UTC (rev 11094)
+++ openlaszlo/trunk/demos/vacation-survey/vacation-survey.lzx	2008-09-19 10:57:33 UTC (rev 11095)
@@ -52,7 +52,7 @@
 
             <form name="form" bgcolor="#c0c0c0" spacing="33">
 
-                <submit id="surveysubmit" data="${surveydataset}" />
+                <submit id="surveysubmit" dataset="${surveydataset}" />
  
                 <view height="20" >
                     <text>What is your favorite vacation spot?</text>
@@ -84,10 +84,18 @@
         <attribute name="vote" type="string" />
         <attribute name="total" type="number" />
         <attribute name="myvote" type="expression" />
-        <attribute name="lcname" value="${this.cname.toLowerCase()}" />
-        <attribute name="img"   value="${'http:' + this.lcname + '.gif' }" />
+        <attribute name="lcname" />
+        <attribute name="img" />
         <attribute name="p"     value="${votes/total}" />
         <attribute name="h"     value="100" />
+        
+        <handler name="oninit">
+            if(this.cname != null){
+                this.setAttribute('lcname', this.cname.toLowerCase());
+                this.setAttribute('img', 'http:' + this.lcname + '.gif');
+                this.pic.setSource(this.img);
+            }
+        </handler>
 
         <simplelayout axis="y" />
         <view bgcolor="#BFBFBF" 
@@ -107,7 +115,7 @@
                           height="${this.parent.height-1}" />
                 </view>
                 <view x="-1" name="voteswatch" bgcolor="black"
-                      visible="${this.classroot.vote == this.classroot.lcname}"
+                      visible="${this.classroot.vote == this.classroot['lcname']}"
                       width="${this.classroot.pic.width}"
                       height="${this.subviews[0].height + 1}" >
                     <votepatch x="1" y="1" height="2" 
@@ -116,7 +124,7 @@
                 <rtext align="center" text="${this.classroot.votes}" /> 
             </view>
         </view>
-        <view name="pic" resource="${this.parent.img}" />
+        <view name="pic" />
         <view height="5" width="1" />
         <rtext width="1" align="center" text="${this.classroot.cname}" /> 
         <view height="5" width="1" />
@@ -135,7 +143,7 @@
                 return;
             }
             if (this.status == 'ok') {
-                if (this.getAttribute('visible') == false) {
+                if (this.visible == false) {
                     this.setAttribute('x', 0);
                     this.setAttribute('visible', true);
                 }

Modified: openlaszlo/trunk/examples/components/form_example.lzx
===================================================================
--- openlaszlo/trunk/examples/components/form_example.lzx	2008-09-19 08:00:14 UTC (rev 11094)
+++ openlaszlo/trunk/examples/components/form_example.lzx	2008-09-19 10:57:33 UTC (rev 11095)
@@ -18,7 +18,7 @@
     <tabs id="tb" x="40" y="$once{tt.y + tt.height}"> 
       <tabpane text="Example 1">
         <form id="ex1">
-            <submit name="submitter" data="${echoer}"/>
+            <submit name="submitter" dataset="${echoer}"/>
 
             <statictext>What is your definition of fun?</statictext>
             <radiogroup x="30" name="definition">
@@ -45,7 +45,7 @@
 
       <tabpane text="Example 2" >
         <form height="${ex1.height}" layout="axis: y; spacing: 15" >
-            <submit name="submitter" data="${echoer}"/>
+            <submit name="submitter" dataset="${echoer}"/>
 
             <view layout="axis: x; spacing: 5">
                 <text y="2" >First name:</text>
@@ -91,7 +91,7 @@
    </tabs>
 </canvas>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 <!-- @LZX_VERSION@                                                         -->

Modified: openlaszlo/trunk/laszlo-explorer/basics/form.lzx
===================================================================
--- openlaszlo/trunk/laszlo-explorer/basics/form.lzx	2008-09-19 08:00:14 UTC (rev 11094)
+++ openlaszlo/trunk/laszlo-explorer/basics/form.lzx	2008-09-19 10:57:33 UTC (rev 11095)
@@ -5,7 +5,7 @@
   
   <window x="10" y="10" >
     <form id="ex1" bgcolor="0xAAB5C8" >
-      <submit name="submitter" data="${echoer}"/>
+      <submit name="submitter" dataset="${echoer}"/>
       
       <statictext fontstyle="bold" >
         What's your current name?

Modified: openlaszlo/trunk/lps/components/base/submit.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/submit.lzx	2008-09-19 08:00:14 UTC (rev 11094)
+++ openlaszlo/trunk/lps/components/base/submit.lzx	2008-09-19 10:57:33 UTC (rev 11095)
@@ -2,8 +2,8 @@
     <!--- Associates a form with a dataset. -->
     <class name="submit" extends="node">
         <!--- The dataset that specifies the request url, which will also hold
-              the result of the query. -->
-        <attribute name="data" value="0" setter="setDataset( data );" />
+              the result of the query. Note: This replaces the "data"-attribute on the submit-component. -->
+        <attribute name="dataset" value="null" />
         <!--- Read-only status of data request. Possible values are 'ok',
               'requesting', and 'error'. Default: 'ok'. -->
         <attribute name="status" type="string" value="ok" />
@@ -13,59 +13,79 @@
 
 
         <!--- @access private -->
-        <attribute name="_timeoutDel" value="0" />
+        <attribute name="_timeoutDel" value="null" />
         <!--- @access private -->
-        <attribute name="_errorDel" value="0" />
+        <attribute name="_errorDel" value="null" />
         <!--- @access private -->
-        <attribute name="_dataDel" value="0" />
+        <attribute name="_dataDel" value="null" />
 
-        <!--- Method to set the dataset associated with form.
-              @param LzDataset dset: a dataset. -->
-        <method name="setDataset" args="dset" >
+        <!--- 
+            @access private 
+            @deprecated Use setAttribute('dataset', ...) instead.
+            @devnote This overrides the setter defined on LzNode only for bwcomp, remove in 4.3+
+        -->
+        <setter name="data" args="dset" >
+            if ($debug) Debug.info("%w.setAttribute('data') is deprecated. Use %w.setAttribute('dataset') instead", this, this);
+            this.setAttribute("dataset", dset);
+        </setter>
+
+        <!--- @access private -->
+        <setter name="dataset" args="dset" >
             this._clearDels();
 
+            this.dataset = dset;
+            // TODO: [20080918 anba] for bwcomp set also "data"-property, remove in 4.3+
             this.data = dset;
 
-            if (dset == 0) {
+            if (dset == null) {
                 return;
             }
 
             this._dataDel = new LzDelegate(this, "_recvdata",
-                                           this.data, "ondata");
+                                           this.dataset, "ondata");
             this._errorDel = new LzDelegate(this, "_recverror",
-                                            this.data, "onerror");
+                                            this.dataset, "onerror");
             this._timeoutDel = new LzDelegate(this, "_recvtimeout",
-                                              this.data, "ontimeout");
+                                              this.dataset, "ontimeout");
+        </setter>
 
+        <!--- Method to set the dataset associated with form.
+              @param LzDataset dset: a dataset. 
+              @deprecated Use setAttribute('dataset', ...) instead.
+        -->
+        <method name="setDataset" args="dset" >
+            if ($debug) Debug.deprecated(this, arguments.callee, this.setAttribute);
+            this.setAttribute("dataset", dset);
         </method>
 
         <!--- @access private -->
         <method name="_recvdata" args="v">
             this.setAttribute('status', 'ok');
+            this.setAttribute('error', '');
         </method>
 
         <!--- @access private -->
         <method name="_recverror" args="v">
-            Debug.error('form submission error: %s', this.data);
+            if ($debug) Debug.error('form submission error: %s', this.dataset);
             this.setAttribute('status', 'error');
-            this.setAttribute('error', this.data.getErrorString());
+            this.setAttribute('error', this.dataset.getErrorString());
         </method>
 
         <!--- @access private -->
         <method name="_recvtimeout" args="v">
-            Debug.error('form submission timeout');
+            if ($debug) Debug.error('form submission timeout');
             this.setAttribute('status', 'timeout');
-            this.setAttribute('error', this.data.getErrorString());
+            this.setAttribute('error', this.dataset.getErrorString());
         </method>
 
         <!--- Data from all sibling components and their children will send as a
               request to the server using 'data' dataset. -->
         <method name="submit"> <![CDATA[
-            if (!this.data) {
+            if (! this.dataset) {
                 return;
             }
             //Debug.write('submit', parent, parent.formdata);
-            var query_data = new LzParam();  // data for the query
+            var query_data = new lz.Param();  // data for the query
             for (var i in parent.formdata) {
                var item = parent.formdata[i];
                var submitname = item.submitname;
@@ -77,8 +97,8 @@
 
             this.setAttribute('status', 'requesting');
             this.setAttribute('error', '');
-            this.data.setQueryString( query_data );
-            this.data.doRequest();
+            this.dataset.setQueryString( query_data );
+            this.dataset.doRequest();
             ]]>
         </method>
 
@@ -102,7 +122,7 @@
         <!--- @access private -->
         <method name="destroy">
             this._clearDels();
-            super.destroy.apply(this, arguments);
+            super.destroy();
         </method>
         
         <doc>

Modified: openlaszlo/trunk/lps/components/lz/form.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/form.lzx	2008-09-19 08:00:14 UTC (rev 11094)
+++ openlaszlo/trunk/lps/components/lz/form.lzx	2008-09-19 10:57:33 UTC (rev 11095)
@@ -151,7 +151,7 @@
               &lt;dataset name="echoer" type="http" src="/@WEBAPP@/examples/components/echo.jsp" /&gt;
               &lt;window id="win" &gt;
               &lt;form&gt;
-              &lt;submit name="survey" data="${echoer}"/&gt;
+              &lt;submit name="survey" dataset="${echoer}"/&gt;
               &lt;statictext&gt;What is your favorite vacation spot?&lt;/statictext&gt;
               &lt;radiogroup name="place"&gt;
               &lt;radiobutton&gt;Hawaii&lt;/radiobutton&gt;



More information about the Laszlo-checkins mailing list