Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 19th, 2006, 03:13 AM
Registered User
 
Join Date: Dec 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data binding analysis of AJAX DataSet and ...

Data binding analysis of AJAX DataSet and DBControl in AJAX WebShop

Viky commend
Brief introduction:

Register the Ojects list related to data, and when the related events happen, an information should be send to these objects. After they receive these information, the related operation would carry out according to the information ID and data.

Information ID:

modify:12
open:0
refresh:5
close:7
move record:3
append:1
delete:2
firedatachange:6
post:13
cancel:9
apply:8
fieldvalue firechange:4
notify lookup dataset:11

Codes analysis:

Here we will take the DBEdit as the example to analysis the way of data binding.
Set the property of DBEdit as DataSet or SetDataSet. Register DBEdit to the data binding list by LinkObj. Actually, the data binding list is an array. When the events happen in DataSet, system will call Notify to notice all the objects in the list and all the objects have an implement of the interface ¨C HandleMessage to be called by DataSet. Refer to the source code below:

DataSet.prototype.Notify=function(act,recno,p){var os=this.linkobjs;if(!os||this.AutoControl==false)r eturn;for(var j=0;j<os.length;j++)if(os[j].HandleMessage)os[j].HandleMessage(this,act,recno,p);}

function DC_handlemessage(sender,msg,recno)
{
   if(msg!=6&&msg!=12)
    this.Refresh();
}
function DC_refresh()
{
  var v,f;
  if(this.DataSet.Active){
   f=this.DataSet.Fields.Field[this.DataField];
   if(!f)jcl_err(this.Name+'.DataField:'+this.DataFie ld+Err_NoField);
   if(f){
    this.readOnly=f.ReadOnly;
    v=f.GetValue();
    if(v==null)v='';this.value=v;
    if(this.Type=='span')this.innerHTML=v;//DBLabel
    if(this.Type=='checkbox'){
if(this.CheckedValue == v){
        this.checked=true;
        this.defaultChecked=true;
      }
else{
        this.checked=false;
      }
    }
   }
  }
  else{
    this.value='';
    if(this.Type=='span')this.innerHTML='';//DBLabel
  }
}








Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding a menu with dataset zaghmout ASP.NET 2.0 Professional 1 August 14th, 2007 05:24 AM
binding the grid to dataset?? thas123 ASP.NET 2.0 Basics 1 December 27th, 2006 02:15 PM
Binding Dataset to DataCombo in .NET TokenBug ADO.NET 4 September 29th, 2006 05:02 AM
Having Trouble With Binding Dataset in Access flyingfox Pro VB.NET 2002/2003 1 August 26th, 2004 03:22 PM
Binding a Dataset to a Report ChrisLane Crystal Reports 4 March 9th, 2004 02:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.