Hi Dioc,
> Hello,
>
> I have written a class that subclasses qx.ui.window.Window and has static
> variable IMAGE_NAME. I pass an instance of the class in the constructor of
> the other class and would like to access static variable IMAGE_NAME by using
> the instance reference. The code looks like:
>
> qx.Class.define("my.package.OtherClass", {
> extend : qx.ui.toolbar.Button,
> construct : function(winService)
> {
> …
> var imgFile = path + winService.self(arguments).IMAGE_NAME + “.png”
> …
> }
>
.self(arguments) will always return a reference to the class the calling
function belongs to regardless of the object you call the method on. In you
case this will always the class the constructor is defined in.
If you have an instance you can get the class using the ".self" property:
winService.self.IMAGE_NAME
Best Fabian
> But winService.self(arguments).IMAGE_NAME is not defined i.e. has
> “undefined” value.
> Did I do something wrong or is it normal?
> How can I access static variable IMAGE_NAME by using the instance reference?
> Is it possible?
>
> Sorry for my English. :-)
>
> Thank you in advance,
> Dioc
>
>
--
Fabian Jakobs
JavaScript Framework Developer
1&1 Internet AG
Brauerstraße 48
76135 Karlsruhe
Amtsgericht Montabaur HRB 6484
Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Andreas Gauger,
Matthias Greve, Robert Hoffmann, Norbert Lang, Achim Weiss
Aufsichtsratsvorsitzender: Michael Scheeren
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel