"this" keyword has different meaning in different points of the script: they
say it "depends on context". this.debug() will work only where "this" refers
to an instance of qx.core.Object or derived class, or any class that
includes qx.core.MLogging mixin.
Explore what is "this" (by calling alert(this), e.g.) at different lines of
your program, and you'll see it's not the same.
For the debug() function to work anywhere in the script, use static method
qx.log.Logger.debug()

--
Regards,
Alexey


Keve Nagy wrote
> Good Evening Everyone!
> I believe this is a newbie question.
> I very much like using the this.debug() call during development. But when
> I try to call it from any function I define inside my qx application code,
> it doesn't work. It resolves as "undefined".
> Example:
> 
>       this.debug("Debug text directly using this.debug()");
>       //
>       var myAlert = function(p_myString) {
>               alert(p_myString);
>               return true;
>       }
>       //
>       myAlert("Indirectly calling alert() from myAlert().");
>       //
>       var myDebug = function(p_myString) {
>               this.debug(p_myString);
>               return true;
>       }
>       //
>       myDebug("Indirect debug via myDebug().");
> 
> The direct call on line #1 works, debug message shows up in the console.
> myAlert gets defined fine, calling myAlert works fine and shows the pop-up
> window.
> Script fails to load during the definition of myDebug, complaining that
> this.debug is "undefined".
> I also tried replacing this.debug() with
> myapplicationnamehere.Application.debug(), also fails.
> 
> How do I call the debug() function from inside my own function?
> Or -if that is what I do wrong- how do I define my own function
> differently to be able to call this.debug() from inside of it?
> 
> Regards,
> Keve Nagy * Debrecen * Hungary
> 
> 
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> qooxdoo-devel mailing list

> [email protected]

> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel





--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Newbie-question-calling-this-debug-from-my-function-tp7585391p7585392.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to