Hi all,

This is rather a javascript question than a qooxdoo specific one

I have some code like this that passe an anonymous function:
foo.bar(p1, function(p2) {
      alert(qx.util.Json.stringify(p2));
});

in foo.bar, i create a button with a listener; when it is executed, the 
following code fails to run:

bar : function(somePara, someFunction) {
    ...
    someButton.addListener("execute", function(e) {
       someFunction(someData);
    });
    ...
}

I google for some documentation and this version works well:

bar : function(somePara, someFunction) {
    ...
    someButton.addListener("execute", function(e) {
       someFunction.call(null, someData);
    });
    ...
}

I don't understand the difference between f.apply(), f.call() and f() 
and why the latter doesn't work

In fact, when using f("foo") the function is executed, but without its 
argument if in the body of the anonymous function i use alert(p2) it fails

Please can you explain this ?

-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to