[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue-appserver/extensions/webfrontend sample.ht...
From: |
Jan Ischebeck |
Subject: |
gnue-appserver/extensions/webfrontend sample.ht... |
Date: |
Mon, 22 Sep 2003 17:50:37 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue-appserver
Branch:
Changes by: Jan Ischebeck <address@hidden> 03/09/22 17:50:37
Modified files:
extensions/webfrontend: sample.html gnue-forms.js
Added files:
extensions/webfrontend: classrepository.html
Log message:
- Make gnue-forms.js be a bit more informative about errors in form
files
- add block tag support
- update sample.html
- add a 50% working classrepository file to show which parts of
master/detail
forms still have to be improved
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/extensions/webfrontend/classrepository.html?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/extensions/webfrontend/sample.html.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/extensions/webfrontend/gnue-forms.js.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: gnue-appserver/extensions/webfrontend/gnue-forms.js
diff -c gnue-appserver/extensions/webfrontend/gnue-forms.js:1.1
gnue-appserver/extensions/webfrontend/gnue-forms.js:1.2
*** gnue-appserver/extensions/webfrontend/gnue-forms.js:1.1 Fri Sep 19
03:43:54 2003
--- gnue-appserver/extensions/webfrontend/gnue-forms.js Mon Sep 22 17:50:37 2003
***************
*** 19,25 ****
// write to the Free Software Foundation, Inc., 59 Temple Place
// - Suite 330, Boston, MA 02111-1307, USA.
//
! // $Id: gnue-forms.js,v 1.1 2003/09/19 07:43:54 siesel Exp $
var gnue_forms_version = "0.0.3"; //jhome
--- 19,25 ----
// write to the Free Software Foundation, Inc., 59 Temple Place
// - Suite 330, Boston, MA 02111-1307, USA.
//
! // $Id: gnue-forms.js,v 1.2 2003/09/22 21:50:37 siesel Exp $
var gnue_forms_version = "0.0.3"; //jhome
***************
*** 48,54 ****
// ****************************************************
var doc;
! function getObjById(id) {
if (document.all) /* MSIE, Konqueror, Opera: --- */
return eval("document.all."+id);
else
--- 48,54 ----
// ****************************************************
var doc;
! function getObjById_unsecure(id) {
if (document.all) /* MSIE, Konqueror, Opera: --- */
return eval("document.all."+id);
else
***************
*** 59,64 ****
--- 59,72 ----
return val;
}
+ function getObjById(id) {
+ val= getObjById_unsecure(id);
+ if (val==undefined) {
+ alert("Couldn't access object '"+id+"'! Probably the forms file has
errors.");
+ };
+ return val;
+ }
+
function GTypecastF() {
this.text = function(obj,field,value) {
obj[field]=value;
***************
*** 646,653 ****
}
this._toHTML=function () {
this._init();
! r ='<input type="text" id="'+this.name+'_field"';
! r+='" onfocus="form.gotoBlock('+"'"+this._block.name+"');"+'"'
r+='>';
return r;
}
--- 654,661 ----
}
this._toHTML=function () {
this._init();
! r ='<input type="text" id="'+this.block+"_"+this.field+'_field"';
! r+='" onfocus="form.gotoBlock('+"'"+this.block+"');"+'"'
r+='>';
return r;
}
***************
*** 661,670 ****
}
this._toHTML=function () {
this._init();
! r ='<input type="text" id="'+this.name+'_field"';
! r+='" onfocus="form.gotoBlock('+"'"+this._block.name+"');"+'"'
! r+='>';
! return r;
}
}
GFLabel.prototype=new GObj();
--- 669,675 ----
}
this._toHTML=function () {
this._init();
! return '';
}
}
GFLabel.prototype=new GObj();
***************
*** 775,781 ****
return false;
}
// hide login dialog
! ld=getObjById("loginForm");
if (ld != undefined) {
ld.style.visibility = "hidden";
}
--- 780,786 ----
return false;
}
// hide login dialog
! ld=getObjById_unsecure("loginForm");
if (ld != undefined) {
ld.style.visibility = "hidden";
}
***************
*** 928,934 ****
}
this.sess.close(this.sessid,0);
getObjById("status").innerHTML="Logged Out";
! ld=getObjById("loginForm");
if (ld != undefined) {
ld.style.visibility = "visible";
}
--- 933,939 ----
}
this.sess.close(this.sessid,0);
getObjById("status").innerHTML="Logged Out";
! ld=getObjById_unsecure("loginForm");
if (ld != undefined) {
ld.style.visibility = "visible";
}
***************
*** 1057,1063 ****
// get the corresponding entry element to a field
this.getEntryElem = function(fname) {
! return getObjById(this.fields[fname]+"_field");
}
// get the corresponding entry element to a field
this.getEntryName = function(fname) {
--- 1062,1068 ----
// get the corresponding entry element to a field
this.getEntryElem = function(fname) {
! return getObjById(this.name+"_"+this.fields[fname]+"_field");
}
// get the corresponding entry element to a field
this.getEntryName = function(fname) {
***************
*** 1065,1071 ****
}
// fetch entry value
this.getEntry = function(fname) {
! e=getObjById(this.fields[fname]+"_field");
if (e!=undefined) {
return e.value;
} else {
--- 1070,1076 ----
}
// fetch entry value
this.getEntry = function(fname) {
! e=getObjById_unsecure(this.name+"_"+this.fields[fname]+"_field");
if (e!=undefined) {
return e.value;
} else {
***************
*** 1074,1080 ****
}
}
this.setEntry = function(fname,newval) {
! getObjById(this.fields[fname]+"_field").value=newval;
}
this.init = function() {
// build list of field out of children
--- 1079,1085 ----
}
}
this.setEntry = function(fname,newval) {
! getObjById(this.name+"_"+this.fields[fname]+"_field").value=newval;
}
this.init = function() {
// build list of field out of children
***************
*** 1168,1174 ****
// 2. Update Statusbar / this should possibly moved into
// the GFForm object
! pos=getObjById("pos");
// first check if statusbar exists
if (pos==undefined) {
--- 1173,1179 ----
// 2. Update Statusbar / this should possibly moved into
// the GFForm object
! pos=getObjById_unsecure("pos");
// first check if statusbar exists
if (pos==undefined) {
***************
*** 1325,1331 ****
child=this._children[i];
// alert(child._type+" : "+child.name)
if (child._type=='GFEntry') {
! getObjById(child.field+"_field").style.visibility=value;
};
if (child._type=='GFLabel') {
getObjById(child.name+"_label").style.visibility=value;
--- 1330,1336 ----
child=this._children[i];
// alert(child._type+" : "+child.name)
if (child._type=='GFEntry') {
!
getObjById(child.block+"_"+child.field+"_field").style.visibility=value;
};
if (child._type=='GFLabel') {
getObjById(child.name+"_label").style.visibility=value;
Index: gnue-appserver/extensions/webfrontend/sample.html
diff -c gnue-appserver/extensions/webfrontend/sample.html:1.1
gnue-appserver/extensions/webfrontend/sample.html:1.2
*** gnue-appserver/extensions/webfrontend/sample.html:1.1 Fri Sep 19
03:43:54 2003
--- gnue-appserver/extensions/webfrontend/sample.html Mon Sep 22 17:50:37 2003
***************
*** 73,93 ****
--- 73,97 ----
entry = new GFEntry(page);
entry._setParent(page);
entry.name='Entry1';
+ entry.block='blkPerson';
entry.field='inpName';
entry = new GFEntry(page);
entry._setParent(page);
entry.name='Entry2';
+ entry.block='blkPerson';
entry.field='inpStreet';
entry = new GFEntry(page);
entry._setParent(page);
entry.name='Entry3';
+ entry.block='blkPerson';
entry.field='inpZip';
entry = new GFEntry(page);
entry._setParent(page);
entry.name='Entry4';
+ entry.block='blkPerson';
entry.field='inpCity';
btn = new GFButton(page);
***************
*** 101,155 ****
<img src="images/commit-24x24.png" name="commit" alt="Commit"
onclick="getForm().commit();;">
<img src="images/newrecord-24x24.png" name="newrec" alt="New Record"
onclick="getForm().newrec();;">
<img src="images/markfordelete-24x24.png" name="trash" alt="Mark for Removal"
onclick="getForm().del();;">
! <img src="images/prevrecord-24x24.png" name="prev" alt="Previous
Record" onclick="getForm().prev();;">
<img src="images/nextrecord-24x24.png" name="next" alt="Next Record"
onclick="getForm().next();;">
! <img src="images/enterquery-24x24.png" name="prepq" alt="Prepare
Query" onclick="getForm().prepQ();;">
<img src="images/execquery-24x24.png" name="query" alt="Execute Query"
onclick="getForm().execQ();;">
! <img src="images/rollback-24x24.png" name="rollback"
alt="Rollback" onclick="getForm().rollback();;">
! <img src="images/about-24x24.png" name="help" alt="About"
onclick="getForm().about();;">
! <img src="images/exit-24x24.png" name="close" alt=""
onclick="getForm().close();;">
! </DIV><DIV STYLE="position:absolute; top: 60px;left: 5px;
width: 525px;height: 240px;border-width: 1px;border-style:
solid;background-color:#EEEEEE;" align="center">
! </DIV><DIV id="pgPerson_page"> <!-- Label lblName -->
! <DIV STYLE="position:absolute; top: 90px;left: 20px;width: 75px;height:
25px;font-size: 15px;line-height: 30px" id="lblName_label">Name:</DIV>
<!-- Label lblStreet -->
! <DIV STYLE="position:absolute; top: 120px;left: 20px;width: 105px;height:
25px;font-size: 15px;line-height: 30px" id="lblStreet_label">Street:</DIV>
<!-- Label lblZip -->
! <DIV STYLE="position:absolute; top: 150px;left: 20px;width: 60px;height:
25px;font-size: 15px;line-height: 30px" id="lblZip_label">Zip:</DIV>
<!-- Label lblCity -->
! <DIV STYLE="position:absolute; top: 180px;left: 20px;width: 75px;height:
25px;font-size: 15px;line-height: 30px" id="lblCity_label">City:</DIV>
<!-- Entry Entry1 -->
! <input type="text" name="Entry1" id="inpName_field"
onfocus="getForm().gotoBlock('blkPerson');"
! STYLE="position:absolute; top: 90px;left: 140px;width: 375px;height:
25px;font-size: 13px;"></textarea>
<!-- Entry Entry2 -->
! <input type="text" name="Entry2" id="inpStreet_field"
onfocus="getForm().gotoBlock('blkPerson');"
! STYLE="position:absolute; top: 120px;left: 140px;width: 375px;height:
25px;font-size: 13px;"></textarea>
<!-- Entry Entry3 -->
! <input type="text" name="Entry3" id="inpZip_field"
onfocus="getForm().gotoBlock('blkPerson');"
! STYLE="position:absolute; top: 150px;left: 140px;width: 375px;height:
25px;font-size: 13px;"></textarea>
<!-- Entry Entry4 -->
! <input type="text" name="Entry4" id="inpCity_field"
onfocus="getForm().gotoBlock('blkPerson');"
! STYLE="position:absolute; top: 180px;left: 140px;width: 375px;height:
25px;font-size: 13px;"></textarea>
<!-- Button Call -->
! <button STYLE="position:absolute; top: 240px;left: 140px;width:
375px;height: 25px;font-size: 13px;" id="Call_button">Show record</button>
</DIV>
! <DIV STYLE="position:absolute; top: 380px;left: 5px;width:
540px;border-width: 1px; border-style: solid;background-color:#EEEEEE;"
align="right">
<div id="status" style="display:inline"></div> |
<div id="pos" style="display:inline"></div> |
! <div id="max" style="display:inline"></div>
</DIV>
! <DIV STYLE="position:absolute; top: 80px;left: 92px;width: 350px;
height: 200px;border-width: 1px; border-style:
solid;background-color:#EEEEEE;visibility=visible"
id="loginForm" align="center">
! <BR>User: <INPUT type="text" id="username"><BR>
Password: <INPUT type="password" id="password"><BR><BR>
<BUTTON onClick="getForm().doLogin();">Login</BUTTON>
</DIV>
--- 105,162 ----
<img src="images/commit-24x24.png" name="commit" alt="Commit"
onclick="getForm().commit();;">
<img src="images/newrecord-24x24.png" name="newrec" alt="New Record"
onclick="getForm().newrec();;">
<img src="images/markfordelete-24x24.png" name="trash" alt="Mark for Removal"
onclick="getForm().del();;">
! <img src="images/prevrecord-24x24.png" name="prev" alt="Previous Record"
onclick="getForm().prev();;">
<img src="images/nextrecord-24x24.png" name="next" alt="Next Record"
onclick="getForm().next();;">
! <img src="images/enterquery-24x24.png" name="prepq" alt="Prepare Query"
onclick="getForm().prepQ();;">
<img src="images/execquery-24x24.png" name="query" alt="Execute Query"
onclick="getForm().execQ();;">
! <img src="images/rollback-24x24.png" name="rollback" alt="Rollback"
onclick="getForm().rollback();;">
! <img src="images/about-24x24.png" name="help" alt="About"
onclick="getForm().about();;">
! <img src="images/exit-24x24.png" name="close" alt=""
onclick="getForm().close();;">
! </DIV>
!
!
! <DIV STYLE="position:absolute; top: 90px;left: 5px;
width: 525px;height: 240px;border-width: 1px;border-style:
solid;background-color:#EEEEEE;" align="center">
! </DIV><DIV id="pgPerson_page"> <!-- Label lblName -->
! <DIV STYLE="position:absolute; top: 120px;left: 20px;width: 75px;height:
25px;font-size: 15px;line-height: 30px" id="lblName_label">Name:</DIV>
<!-- Label lblStreet -->
! <DIV STYLE="position:absolute; top: 150px;left: 20px;width: 105px;height:
25px;font-size: 15px;line-height: 30px" id="lblStreet_label">Street:</DIV>
<!-- Label lblZip -->
! <DIV STYLE="position:absolute; top: 180px;left: 20px;width: 60px;height:
25px;font-size: 15px;line-height: 30px" id="lblZip_label">Zip:</DIV>
<!-- Label lblCity -->
! <DIV STYLE="position:absolute; top: 210px;left: 20px;width: 75px;height:
25px;font-size: 15px;line-height: 30px" id="lblCity_label">City:</DIV>
<!-- Entry Entry1 -->
! <input type="text" name="Entry1" id="blkPerson_inpName_field"
onfocus="getForm().gotoBlock('blkPerson');"
! STYLE="position:absolute; top: 120px;left: 140px;width: 375px;height:
25px;font-size: 13px;"value="">
<!-- Entry Entry2 -->
! <input type="text" name="Entry2" id="blkPerson_inpStreet_field"
onfocus="getForm().gotoBlock('blkPerson');"
! STYLE="position:absolute; top: 150px;left: 140px;width: 375px;height:
25px;font-size: 13px;"value="">
<!-- Entry Entry3 -->
! <input type="text" name="Entry3" id="blkPerson_inpZip_field"
onfocus="getForm().gotoBlock('blkPerson');"
! STYLE="position:absolute; top: 180px;left: 140px;width: 375px;height:
25px;font-size: 13px;"value="">
<!-- Entry Entry4 -->
! <input type="text" name="Entry4" id="blkPerson_inpCity_field"
onfocus="getForm().gotoBlock('blkPerson');"
! STYLE="position:absolute; top: 210px;left: 140px;width: 375px;height:
25px;font-size: 13px;"value="">
<!-- Button Call -->
! <button STYLE="position:absolute; top: 270px;left: 140px;width:
375px;height: 25px;font-size: 13px;" id="Call_button">Show record</button>
</DIV>
! <DIV STYLE="position:absolute; top: 410px;left: 5px;width:
540px;border-width: 1px; border-style: solid;background-color:#EEEEEE;"
align="right">
<div id="status" style="display:inline"></div> |
<div id="pos" style="display:inline"></div> |
! <div id="max" style="display:inline"></div>
</DIV>
! <DIV STYLE="position:absolute; top: 110px;left: 92px;width: 350px;
height: 200px;border-width: 1px; border-style:
solid;background-color:#EEEEEE;visibility=visible"
id="loginForm" align="center">
! <BR>User: <INPUT type="text" id="username"><BR>
Password: <INPUT type="password" id="password"><BR><BR>
<BUTTON onClick="getForm().doLogin();">Login</BUTTON>
</DIV>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue-appserver/extensions/webfrontend sample.ht...,
Jan Ischebeck <=