2009-02-25 2 views

Répondre

0

Il n'y a pas de plugin pour cela. DwrYuiDataSource prend actuellement en charge les méthodes distantes de la forme

public ReturnType methodName(String query) 

Mais pourrait facilement être étendu à prendre beforeArgs et afterArgs afin qu'il supporte

public ReturnType methodName(Object beforeArg1, Object beforeArg2, 
    String query, Object afterArg1, Object afterArg2) 

javascript: DwrYuiDataSource

mypackage.DwrYuiDataSource = function(remoteMethod) { 
    this.remoteMethod = remoteMethod; 
    this._init(); 
}; 

mypackage.DwrYuiDataSource.prototype = new YAHOO.widget.DataSource(); 

mypackage.DwrYuiDataSource.prototype.doQuery = function(oCallbackFn, 
sQuery, oParent) { 
    var oSelf = this; 
    this.remoteMethod(sQuery, function(aResults) { 
     var resultObj = {}; 
     resultObj.query = decodeURIComponent(sQuery); 
     resultObj.results = aResults; 
     oSelf._addCacheElem(resultObj);  
     oSelf.getResultsEvent.fire(oSelf, oParent, sQuery, aResults); 
     oCallbackFn(sQuery, aResults, oParent); 
    }); 
}; 
Questions connexes