Passing Parameters To Callback Function In DWR

DWR is one of Most Finest written libraries for web development which has made life of many developers easy. It made developers feel AJAX as Kids Langugage. It has created blanket over a rough path of Road Which Javascript Provides while manipulating Objects. Here i would explain how to pass Parameters to A callback function in DWR. I assume reader to be aware of how DWR works before reading this

I’m attaching code snippet which is self explanatory


// define an erasure function to store a reference to
// dataFromBrowser and to call dataFromServer
var callbackProxy = function(bucketMap) {
fillBucketTypes(dataFromServer, dataFromBrowser );
};

SystemDAO.getBucketTypes(callbackProxy);
}

dataFromBrowser is the parameters which is passed here
function fillBucketTypes(bucketMap,dataFromBrowser ){
//alert("In Filling "+presentBucketTypeId);
var tempBucketTypeId = "bucketType" + String(dataFromBrowser );
dwr.util.addOptions(tempBucketTypeId, bucketMap, true);
}

Advertisements

One thought on “Passing Parameters To Callback Function In DWR

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s