s.kerroumi
4 Jan 2008, 5:31 AM
hello,
I'm newbie in ExtJs so i need some informations...
i have a Jsp displaying a list of customers
i call my back-end with combo extJs+dwr via DWRPRoxy here is my implementation :
Ext.data.DWRProxy = function (f) {
Ext.data.DWRProxy.superclass.constructor.call(this);
this.func = f;
};
Ext.extend(Ext.data.DWRProxy, Ext.data.DataProxy, {
load : function(params, reader, callback, scope, arg) {
document.dwr = {params:params, reader:reader, callback:callback, scope:scope, arg:arg};
this.func.call(this, arg, {
callback: this.loadResponse,
exceptionHandler: this.failure,
});
},
loadResponse : function(response) {
var dwr = document.dwr;
delete document.dwr;
var result;
try {
result = dwr.reader.read(response);
}catch(e){
this.fireEvent("loadexception", this, o, response, e);
dwr.callback.call(dwr.scope, null, dwr.arg, false);
return;
}
dwr.callback.call(dwr.scope, result, dwr.arg, true);
},
failure : function(o, success, response) {
console.log("Failed"); // Not finished yet but should probably just call a failure callback
},
update : function(params, records){
}
});
i have a filter formular on these customers to, with several field.
i map those fields by creating a Javascript Object :
var filterClients = {pagename:null,number_value:null,name_value:null,location_id_value:null,parentCode_value:null,hideAll_value:null,country_id_value:null,exclusiveOnly_value:null};
i populate this object by this way :
dwr.util.getValues(filterClients);
so it fills corresponding values. it works fine.
On my server side, i have a method :
public Object[] loadCustomers(final FilterClients filter)
loadCustomers wait for a filter parameter of type FilterClients
my dwr.xml declare this object so it can be marshalled by DWR :
<convert converter="bean" match="com.clientssettings.filter.dwr.impl.FilterClients"/>
my question is : How the hell can i pass this filterClients Javascript Object properly with DWRProxy???????
I'm newbie in ExtJs so i need some informations...
i have a Jsp displaying a list of customers
i call my back-end with combo extJs+dwr via DWRPRoxy here is my implementation :
Ext.data.DWRProxy = function (f) {
Ext.data.DWRProxy.superclass.constructor.call(this);
this.func = f;
};
Ext.extend(Ext.data.DWRProxy, Ext.data.DataProxy, {
load : function(params, reader, callback, scope, arg) {
document.dwr = {params:params, reader:reader, callback:callback, scope:scope, arg:arg};
this.func.call(this, arg, {
callback: this.loadResponse,
exceptionHandler: this.failure,
});
},
loadResponse : function(response) {
var dwr = document.dwr;
delete document.dwr;
var result;
try {
result = dwr.reader.read(response);
}catch(e){
this.fireEvent("loadexception", this, o, response, e);
dwr.callback.call(dwr.scope, null, dwr.arg, false);
return;
}
dwr.callback.call(dwr.scope, result, dwr.arg, true);
},
failure : function(o, success, response) {
console.log("Failed"); // Not finished yet but should probably just call a failure callback
},
update : function(params, records){
}
});
i have a filter formular on these customers to, with several field.
i map those fields by creating a Javascript Object :
var filterClients = {pagename:null,number_value:null,name_value:null,location_id_value:null,parentCode_value:null,hideAll_value:null,country_id_value:null,exclusiveOnly_value:null};
i populate this object by this way :
dwr.util.getValues(filterClients);
so it fills corresponding values. it works fine.
On my server side, i have a method :
public Object[] loadCustomers(final FilterClients filter)
loadCustomers wait for a filter parameter of type FilterClients
my dwr.xml declare this object so it can be marshalled by DWR :
<convert converter="bean" match="com.clientssettings.filter.dwr.impl.FilterClients"/>
my question is : How the hell can i pass this filterClients Javascript Object properly with DWRProxy???????