Clear Up
SharpKit Reference

RemotingProviderConfig Class

Namespace: Ext.direct

Base Types

System.Object

Constructors

Name Description
RemotingProviderConfig()

Properties

Name Description
actions Object literal defining the server side actions and methods. For example, if the Provider is configured with:
  
"actions":{ // each property within the 'actions' object represents a server side Class
"TestAction":[ // array of methods within each server side Class to be
{              // stubbed out on client
"name":"doEcho",
"len":1
},{
"name":"multiply",// name of method
"len":2           // The number of parameters that will be used to create an
// array of data to send to the server side function.
// Ensure the server sends back a Number, not a String.
},{
"name":"doForm",
"formHandler":true, // direct the client to use specialized form handling method
"len":1
}]
}
            

Note that a Store is not required, a server method can be called at any time. In the following example a client side handler is used to call the server side method "multiply" in the server-side "TestAction" Class:

  
TestAction.multiply(
2, 4, // pass two arguments to server, so specify len=2
// callback function after the server is called
// result: the result returned by the server
//      e: Ext.direct.RemotingEvent object
function(result, e){
var t = e.getTransaction();
var action = t.action; // server side Class called
var method = t.method; // server side method called
if(e.status){
var answer = Ext.encode(result); // 8
}else{
var msg = e.message; // failure message
}
}
);
            
In the example above, the server side "multiply" function will be passed two arguments (2 and 4). The "multiply" method should return the value 8 which will be available as the result in the example above.
enableBuffer
enableUrlEncode Specify which param will hold the arguments for the method. Defaults to 'data'.
maxRetries Number of times to re-attempt delivery on failure of a call. Defaults to 1.
namespace Namespace for the Remoting Provider (defaults to the browser global scope of window). Explicitly specify the namespace Object, or specify a String to have a {@link Ext#namespace namespace created} implicitly.
url Required. The url to connect to the {@link Ext.direct.Manager} server-side router.
© Copyright 2005-2011 SharpKit. All rights reserved.