commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r6907 - trunk/gnue-appserver/extensions/webfrontend


From: jan
Subject: [gnue] r6907 - trunk/gnue-appserver/extensions/webfrontend
Date: Sun, 16 Jan 2005 07:50:23 -0600 (CST)

Author: jan
Date: 2005-01-16 07:50:22 -0600 (Sun, 16 Jan 2005)
New Revision: 6907

Modified:
   trunk/gnue-appserver/extensions/webfrontend/gnue-forms.js
Log:
adapt to changes in tranfering conditions over xmlrpc
minor cleanups


Modified: trunk/gnue-appserver/extensions/webfrontend/gnue-forms.js
===================================================================
--- trunk/gnue-appserver/extensions/webfrontend/gnue-forms.js   2005-01-16 
10:32:55 UTC (rev 6906)
+++ trunk/gnue-appserver/extensions/webfrontend/gnue-forms.js   2005-01-16 
13:50:22 UTC (rev 6907)
@@ -21,7 +21,7 @@
 //
 // $Id: gnue-forms.js,v 1.2 2003/09/22 21:50:37 siesel Exp $
 
-var gnue_forms_version = "0.0.3";  //jhome
+var gnue_forms_version = "0.0.4"; 
 
 
 // TODO: - save/delete/insert (done) 
@@ -354,6 +354,10 @@
   this.dodelete = function (sessionid,classname,objids) {
     return XMLRPC.call(this.host,'Session.delete',sessionid,classname,objids);
   };
+  this.getFilters = function (language) {
+    return XMLRPC.call(this.host,'Session.getFilters',language);
+  }
+
 }
 function Management(sess,sessid) {
   this.Restart = function() {
@@ -418,9 +422,10 @@
     
this.data=this.sess.fetch(this.sessid,this.listid,this.listpos,this.cacheS);
 
     // 2. check if still data there
-    if (this.data==0) {
-      return 0;
+    if ((this.data==0)|| (this.data==undefined))  {
+      return 0; 
     }
+
     // 3. for all new records
     for (x in this.data) {
       if (x!="toXMLRPC") {
@@ -592,35 +597,20 @@
     this._fields=fields;
   };
   this.createEmptyResultSet = function() {
-    return this.createResultSet(Array(Array("eq",""),
+    return this.createResultSet(Array(Array("eq",
                                      Array("const","1"),
-                                     Array("const","0")));
+                                     Array("const","0"))));
   };
   this.createResultSet = function(condition) {
-    //if (this.master!=undefined) {
-      // get master
-      //for (x in this._parent._children) {
-    //if (this._parent._children[x].name==this.master) {
-    //   master=this._parent._children[x]
-    // }
-    // }
-      // register call back in master object
-      // master.detailsource[master.detailsource.length+1]=this
 
-      // fetch masterfield from master object
-
-       //masterval=master.getField(this.masterlink);
-    // masterval="AK"
-
-      // add to condition
-      //condition=Array(Array("eq",""),Array("field",this.detaillink),
-    //               Array("const",masterval));
-    //}
     sortorder=Array();
     if (this.order_by!=undefined) {
       // TODO: split order_by to support "field1,field2" values 
       sortorder[0]=this.order_by;
     }
+    if (condition==undefined) {
+      condition = Array(Array("eq",Array("const","0"),Array("const","0")));
+    }
     listid=this._sess.request(this._sessid,this.table,
                              condition,sortorder,this.buildPrefetch());
     if (listid==0) {
@@ -721,7 +711,7 @@
 GFForm.prototype=new GObj();
 function GFForm(myparent){
   this._type="GFForm";
-  this.version = '0.0.1';
+  this.version = gnue_forms_version;
   this.blocks = Array();
   this.changed=false;
   this.busy=0; // should be set to one if busy // similar to global lock
@@ -840,10 +830,14 @@
     r+="Name: "+this.name+"\n";
     alert(r);
   }
+  this.executeTrigger = function(triggername) {
+    alert ("Trigger '"+triggername+"' is executed!");
+  }
   this.gotoBlock = function (blockname) {
     if (this.cur_block.name==blockname) {
-      return
+      return true
     };
+    setStatus("Active Block: "+blockname+" (Last Block: "+ 
this.cur_block.name+ ")");
     this.cur_block.getState();
     for (ik in this.blocks) {
       if (this.blocks[ik].name==blockname) {
@@ -852,6 +846,7 @@
       }
     }
     this.cur_block.showState();
+    return true;
   }
   this.gotoPage = function (pgname) {
     //    this.cur_block.update();
@@ -1003,7 +998,7 @@
   }
   this.showButton=function(img,name,alt,command,key) {
     b='<img src="images/'+img+'.png" name="'+name+'" alt="'+alt+'" onclick="'+
-    command+';">\n';
+    command+';" onmouseover="'+name+'_mouseover();">\n';
     return b;
   }
   this.showNavigationBar=function() {
@@ -1124,15 +1119,15 @@
        // MASTER DATASOURCE initialized -> fetch masterlink field and compute 
        // client recordset
        this.masterval = h._curRec.get(this._datasource.masterlink);
-       cond=Array(Array("eq",""),Array("field",this._datasource.detaillink),
-                  Array("const",this.masterval));
+       cond=Array(Array("eq",Array("field",this._datasource.detaillink),
+                  Array("const",this.masterval)));
        this._rset=this._datasource.createResultSet(cond);
       }        
     } else {
       if ((this._datasource.prequery!=undefined)&&
          (this._datasource.prequery!='0')&&
          (this._datasource.prequery!='N')) {
-       this._rset=this._datasource.createResultSet(Array());
+       this._rset=this._datasource.createResultSet(undefined);
       } else {
        this._rset=this._datasource.createEmptyResultSet();
       }
@@ -1209,8 +1204,8 @@
       this._rset._post()
     };
     this.masterval = masterrec.get(this._datasource.masterlink);
-    cond=Array(Array("eq",""),Array("field",this._datasource.detaillink),
-               Array("const",this.masterval));
+    cond=Array(Array("eq",Array("field",this._datasource.detaillink),
+               Array("const",this.masterval)));
     this._rset=this._datasource.createResultSet(cond);
     this._curRec=this._rset.currentRecord();
     this.updateDetailDts();
@@ -1288,12 +1283,12 @@
                  cond.push(Array("lt",""));
                  val=val.substr(1,val.length);
              } else {
-           //  cond.push(Array("eq",""));
-             cond.push(Array("like",""));  //use like instead of eq
+           //  changed condition behavior
+             cond.push(Array("like",Array("field",fname),Array("const",val)));
+                    //use like instead of eq
              }
            }
-           cond.push(Array("field",fname));
-           cond.push(Array("const",val));
+           //cond.push();
          }
        }
       }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]