Hi Mustafa, Mustafa Sak wrote: > Alexander wrote: > >> What are these two parameters supposed to do? Maybe there is another > solution for your problem. > > sobj and dobj are just some window objects. I think a work around is to > initialise both objects on the main function and use some code like this: > main : funtion() > { > ... > this.win=this.makeWinFunction(); > > this.cobj=this.makeCobjFunction(); > this.dobj=this.makeDobjFunction(); > > this.win.form.bntLoginSubmit.addListener("execute", this.openKmpWin > ,this); > > > ... > }, > > openKmpWin : function() > { > alert(this.cobj); > alert(this.dobj); > }, > > > But I hope there is an other way to handle this. I dont like to set > everything to a global object. That's the best way to go. Holding the references to window instances should do the job since you need to access these instances several times in your application code.
cheers, Alex > Von: Alexander Back [mailto:alexander.b...@1und1.de] > Gesendet: Do 08.01.2009 15:45 > An: qooxdoo Development > Betreff: Re: [qooxdoo-devel] Invalid callback function > > > > Hi Mustafa, > > Mustafa Sak wrote: >> it works, but i have to send parameters to the callbackfunktion like: >> this.openKmpWin(sobj, dobj) > Callback functions are called by the event manager whenever the event > occured. They get the event as parameter and thus it is not possible to > send parameters to the callback function. > > What are these two parameters supposed to do? Maybe there is another > solution for your problem. > > cheers, > Alex > >> Von: Alexander Back [mailto:alexander.b...@1und1.de] >> Gesendet: Do 08.01.2009 08:45 >> An: qooxdoo Development >> Betreff: Re: [qooxdoo-devel] Invalid callback function >> >> >> >> Hi Mustafa, >> >> Mustafa Sak wrote: >>> Greatings, >>> >>> i'm getting this console message: >>> [Exception... "'Failed to add event listener for type 'execute' to the >>> target 'qx.ui.form.Button[2m]': Invalid callback function: Expected value >>> to be typeof function but found undefined!' when calling method: >>> [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c >>> (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "<unknown>" data: no] >> Easy one. Just remove the "()" to hand over the function itself (not the >> result of the function). >> >> --snip-- >> // the line >> win.form.bntLoginSubmit.addListener("execute", this.openKmpWin(),this); >> >> // has to be >> win.form.bntLoginSubmit.addListener("execute", this.openKmpWin, this); >> --snip-- >> >> since the "addListener" method expects a function as second parameter. >> In the line above you do *call* the function directly and end up with >> the result of the function which is "undefined" because your function >> does not have a return value. >> >> cheers, >> Alex >> >>> my source looks like this: >>> >>> makeLoginWin : function() >>> { >>> var win = new qx.ui.window.Window("Login", >>> "icon/16/apps/office-calendar.png"); >>> this.root.add(win); >>> win.form = new qx.ui.container.Composite(new qx.ui.layout.Grid(3,2)); >>> win.form.bntLoginSubmit = new qx.ui.form.Button("Login"); >>> win.form.bntLoginSubmit.addListener("execute", this.openKmpWin(),this); >>> win.form.add(win.form.bntLoginSubmit, {row: 2, column: 1}); >>> win.add(win.form); >>> return win; >>> }, >>> >>> openKmpWin : function() >>> { >>> alert("DEBUG"); >>> >>> }, >>> >>> I can't figure it out. >>> >>> regards >>> Mustafa Sak ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel