Re: [qooxdoo-devel] this reference

2012-09-05 Thread Loren Schlomer
Good! Glad to help! On Wed, Sep 5, 2012 at 7:05 AM, media wrote: > hooray it works! > thank you Loren. > > qx.Class.define("tswmobile.page.BarcodeList", > { > extend : qx.ui.mobile.page.NavigationPage, > > members : > { > _initialize : function() > { > this.base(arguments);

Re: [qooxdoo-devel] this reference

2012-09-05 Thread media
hooray it works! thank you Loren. qx.Class.define("tswmobile.page.BarcodeList", { extend : qx.ui.mobile.page.NavigationPage, members : { _initialize : function() { this.base(arguments); var tlb1 = new qx.ui.mobile.toolbar.ToolBar(); this.add(tlb1); v

Re: [qooxdoo-devel] this reference

2012-09-05 Thread Loren Schlomer
Take a look at: qx.lang.Function.bind() This will return a function bound with the correct this pointer. So you'll do something like: var callback = qx.lang.Function.bind(this.__queryDB, this); and then use callback: db.transaction(callback) http://demo.qooxdoo.org/current/apiviewer/#qx.lang

Re: [qooxdoo-devel] this reference

2012-09-05 Thread media
thanks but the call *db.transaction.call(this, this.__queryDB)* does not work. here is the original example of the PhoneGap homepage http://docs.phonegap.com/en/2.0.0/cordova_storage_storage.md.html#Database http://docs.phonegap.com/en/2.0.0/cordova_storage_storage.md.html#Database *Ex

Re: [qooxdoo-devel] this reference

2012-09-05 Thread Ed Adasiewicz
Without knowing what db.transaction() performs, have you tried replacing db.transaction(this.__queryDB); with db.transaction.call(this, this.__queryDB); -- View this message in context: http://qooxdoo.678.n2.nabble.com/this-reference-tp7581251p7581253.html Sent from the qooxdoo mailing lis

[qooxdoo-devel] this reference

2012-09-05 Thread media
Hi there, im a Qooxdoo beginner and i have a problem with the 'this' reference. How do I get a 'this' reference in a member subfunction (__queryDB) does anyone have a solution for that? Thanks! qx.Class.define("tswmobile.page.BarcodeList", { extend : qx.ui.mobile.page.NavigationPage,

Re: [qooxdoo-devel] this reference

2009-11-24 Thread MartinWittemann
Hi Michael, if you pass function pointers, you will loos the context (as you do in the listener of the button). JavaScript offers a way of setting the context my using the call method of functions: guiMethod :function(method) { method.call(this.server, this); }, The first argument i

[qooxdoo-devel] this reference

2009-11-24 Thread Michael Greifeneder
Hello, I have a strange problem, that's probably easily solved with a little JavaScript/Qooxdoo knowledge. Clicking on the button in the example code below causes this error: this.internMethod is not a function [Break on this error] this.internMethod();\n Classes test.Application and test.Server

Re: [qooxdoo-devel] this reference in callback?

2009-04-06 Thread thron7
Thanks, I changed that. T. Matthew Gregory wrote: > Thanks for this, > Using 'self' for colusures is actually suggested here: > http://qooxdoo.org/documentation/general/javascript_best_practises#using_self_for_closures > > I tend not to use self as it reminds me of some stuff I had to do in > o

Re: [qooxdoo-devel] this reference in callback?

2009-04-06 Thread Matthew Gregory
Thanks for this, Using 'self' for colusures is actually suggested here: http://qooxdoo.org/documentation/general/javascript_best_practises#using_self_for_closures I tend not to use self as it reminds me of some stuff I had to do in object pascal and makes me nauseous thron7 wrote: > > Matthew

Re: [qooxdoo-devel] this reference in callback?

2009-04-06 Thread Roman Schmid
Ouch.. good to know. thron7 wrote: > > Matthew Gregory wrote: >> There are a few solutions, can you show your code? >> >> If you are using rpc with event handlers, when you add your listener >> pass 'this' (without quotes) as the third parameter. >> >> Otherwise you might have to do something l

Re: [qooxdoo-devel] this reference in callback?

2009-04-06 Thread thron7
Matthew Gregory wrote: > There are a few solutions, can you show your code? > > If you are using rpc with event handlers, when you add your listener > pass 'this' (without quotes) as the third parameter. > > Otherwise you might have to do something like this: > > var self = this; > Guys, nev

Re: [qooxdoo-devel] this reference in callback?

2009-04-06 Thread Michael Ochs
Thanks, that did the trick! :) Am 06.04.2009 um 15:50 schrieb Matthew Gregory: There are a few solutions, can you show your code? If you are using rpc with event handlers, when you add your listener pass 'this' (without quotes) as the third parameter. Otherwise you might have to do somethin

Re: [qooxdoo-devel] this reference in callback?

2009-04-06 Thread Timo
have you ever tryed to compile with string optimization? when i you used this solution i got an error when i build with string optimze. timo Am Mo, 6.04.2009, 15:50, schrieb Matthew Gregory: > There are a few solutions, can you show your code? > > If you are using rpc with event handlers, when you

Re: [qooxdoo-devel] this reference in callback?

2009-04-06 Thread Matthew Gregory
There are a few solutions, can you show your code? If you are using rpc with event handlers, when you add your listener pass 'this' (without quotes) as the third parameter. Otherwise you might have to do something like this: var self = this; foo(... function() { // in your callback function u

Re: [qooxdoo-devel] this reference in callback?

2009-04-06 Thread Andy Colson
Michael Ochs wrote: > Hi, > > I'm trying to load a callback function (after rcp request) and make a > new table model in this callback function. This table model is stored > in this.tableModel but I noticed, that in this case the reference of > this points to Window whereas everywhere else t

[qooxdoo-devel] this reference in callback?

2009-04-06 Thread Michael Ochs
Hi, I'm trying to load a callback function (after rcp request) and make a new table model in this callback function. This table model is stored in this.tableModel but I noticed, that in this case the reference of this points to Window whereas everywhere else this points to frontend.Applica