Hi John,
"arguments" is feature of the javascript language.
You can use it in a function if you want to know exactly what arguments
were passed to that function. It's often used to write functions that
have dynamic parameter lists.
For example:
f = function() {
for (var i=0; i < arguments.length; i++) {
alert(arguments[i]);
}
}
f("hello", "world"); //this will show two popups
Arguments also contains some information about what function is being
called, and what function called it. Qooxdoo uses that info to implement
inheritance. That's why you always need to send it to a super function
as first parameter.
---
As for your override question: I'm not sure what you're trying to
accomplish. The callSync method of qx.io.remote.Rpc accepts only a
single parameter, so there is not point in called that function with two
added parameters.
I think you might be trying to do it backwards?! If you're trying to add
two parameters to your own callSync function, you can do something like
this:
qx.Class.define("qxwebapp.rpc.Rpc",
{
extend : qx.io.remote.Rpc,
members :
{
callSync: function(methodName) {
this.setUsername('john');
this.setPassword('password');
this.base(arguments, methodName);
}
}
});
I hope this helps. Or maybe I didn't understand your question right?
Regards,
Marc
On 09/01/2011 08:40 PM, John de la Garza wrote:
> I'm trying to extend the rpc class to have it pass a name and pw
>
> I can't find any docs on what the variable arguments is used for.
>
> I am trying to override callSync so it calls the super call Sync and
> adds two parameters. Any ideas?
>
> qx.Class.define("qxwebapp.rpc.Rpc",
> {
> extend : qx.io.remote.Rpc,
> members :
> {
> uname : null,
> passwd: null,
>
> callSync: function(methodName){
> this.debug('my sync call');
> this.debug('args: '+qx.util.Json.stringify(arguments));
> for (var i in arguments) this.debug('i: '+arguments[i]);
> this.debug('type args: '+typeof(arguments));
> arguments.callee.base.apply(this, arguments, 'john','password');
>
> //this.base(arguments, 'john', 'password');
> }
>
> }
> });
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel