Hi,

you can rewrite it to:
   this._yourButton.addListener("execute", this._onExecute, this);

and in your class you should create _onExecute member function:
   _onExecute: function(ev)
   {
     // do something useful...
   }

or you can of course pass this to inline event handler:
   this._yourButton.addListener("execute", function(ev) {
     this.thisIsStillValid();
   }, this);

Important is third argument - 'this'.

Just forget the way used in other libraries like jQuery, etc. In
qooxdoo you have real object oriented design and you can really
connect objects together:)

2009/10/24 JB <[email protected]>:
> OK, what is the typical way people manipulate objects from an event
> handler.  This is another thing that is driving me crazy.  I have the
> event handlers working but they can never do anything useful because
> everything they need to access is not available from within the
> handler.  This makes it really challenging to write well organized code
> because everything that needs to reference anything must all be in the
> same object and then handlers need to be defined multiple times so they
> can get at what they need!
>
> They typical:
> button1.addListener("execute", function(e) {
>    bla bla bla
> });
>
> is really getting out of hand in my application.  Seriously, how do
> people manage this?  I'm used to having access to members and other
> objects in other class oriented languages.
>
> Thanks,
> Jared
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>



-- 
Best regards
- Petr Kobalicek <http://kobalicek.com>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to