On Sun, Mar 7, 2010 at 12:59, Qoodary <[email protected]> wrote:
> I made a function "getTableData" which gets the file information and makes
> an array to show it in the table. (this works also if I put this into the
> main window)
>
> I tried to call the function "this.getTableData();" in the "getModalWindow1
> : function()" and here in the "form.addListener('completed',function(e)"
> because I thought this is the right place when the file is uploaded.
>
> But I receive the error message
> this.getTableData is not a function
>
> How can I access from the "getModalWindow1" function the tablemodel in the
> main function.
>
It looks like you almost had it, but you commented out the change you have
to make...
form.addListener('completed',function(e) {
> //var that = this;
> this.debug('completed');
> file.setFieldValue('');
> var response = this.getIframeHtmlContent();
> this.debug(response);
>
> ////////////////////////////////////////////////////////////////
>
> ////////////////////////////////////////////////////////////////
> this.getTableData();
>
> ///////////////////////////////////////////////////////////////////
>
> ////////////////////////////////////////////////////////////////////
> wm1.close();
> });
> //}, this);
>
The third parameter to addListener() is the "context" to use inside of the
handler function. If you don't pass a third parameter, as is the case right
now (since the very last line above is commented out and the one before it
is used instead), then the object on which addListener() is called is used
as the context. This means that when you call this.getTableData(), what it's
really doing is calling form.getTableData() since that's inside the handler
function created with form.addListener().
If you add the third parameter 'this' by uncommenting this last line and
instead commenting or deleting the preceding one, then 'this' inside of the
handler function will refer to that third parameter, which is your
firstQxApp.Application instance as you desire.
Cheers,
Derrell
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel