hello there. i want to simplify the usage of rpc and ran into a problem with
the handler. example:

usage:
-------------------------------------------------------------------------------------

var rpc = new qxgui.utils.Rpc;
rpc.callAsync( "doLogin", [ username, userpw ] );
var result = rpc.getResult();


class:
-------------------------------------------------------------------------------------

qx.Class.define("qxgui.utils.Rpc",
{
    extend: qx.core.Object,
    
    construct: function( url, service )
    {
        // standard-paramenter
       some statements ...
        
        // konfigurieren
        rpc = new qx.io.remote.Rpc( url, service );
        
        rpc.setTimeout( this.__timeout );
        rpc.setCrossDomain( this.__crossDomain );
        
        this.__rpc = rpc;
    },
    
    members:
    {
        // eigenschaften
       
////////////////////////////////////////////////////////////////////////
        
        __url: "xxx",
        __service: "xxx",
        __timeout: 5000,
        __crossDomain: true,
        
        __rpc: null,
        __id: null,
        __exc: null,
        __result: null,
        __rpcRunning: null,
        
        
        // methoden
       
////////////////////////////////////////////////////////////////////////
        
        callAsync: function( method, args )
        {
            var handler = function( result, exc, id )
            {
                if ( exc == null )
                {
                    this.__result = result;
                }
                else {
                    alert( "RPC-Exception: " + exc );
                }
            };
            
            this.__rpcRunning = this.__rpc.callAsync( handler, method, args
);
        },
        
        isRpcRunning: function()
        {
            return this.__rpcRunning;
        },
        
        getResult: function()
        {
            return this.__result;
        }
    }
});


how do i get the result into the right scope?
-- 
View this message in context: 
http://n2.nabble.com/problems-with-rpc-abstraction-%28-using-this-in-callback-function-%29-tp2792185p2792185.html
Sent from the qooxdoo mailing list archive at Nabble.com.


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to