Clear Up
SharpKit Reference

RemotingProviderConfig Class


Base Types



Name Description


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":"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.
"formHandler":true, // direct the client to use specialized form handling method

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:

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: object
function(result, e){
var t = e.getTransaction();
var action = t.action; // server side Class called
var method = t.method; // server side method called
var answer = Ext.encode(result); // 8
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.
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} server-side router.
© Copyright 2005-2011 SharpKit. All rights reserved.