Thanks Jim,
what you're saying 'kinda' makes sense to me even though I still don't
fully understand:
Yes, I understand the 'var QxCanvasLayout1...' lives locally inside that
function and is gone after execution of the function.
However I thought the execution of "loFrame.add(QxCanvasLayout1);" must
create a reference to the (underlying QxCanvasLayout) object and thus
prevent that object itself from being garbage collected?
And further: loFrame still exists because it's scope is still alive.
Shouldn't I be able to get to that object which was added to loFrame
even though obviously not under the name it was created (I'd have to
attach some id - I guess)?
Following your suggestion could I do something like having - say a
toplevel array of variables - and create my 'on-the-fly' QxCanvasLayout
with one new array-element as reference? And later search through that
array to find the object?
Would qooxdoo have some machinery to achieve that sort of thing
(creating objects on-the-fly and later being able to refer to them) or
am I doing something unusual?
If I may exploit your willingness to help, could I ask you to jot down a
few lines (of code) how you would replace my eval(..) with a call to a
toplevel function and how that function would look like... and then a
line where I access that 'on-the-fly' object?
Thanks again for being so helpful, Jim
Regards
Ralf
Jim Hunter wrote:
This looks like a scope issue. You are declaring QxCanvasLayout1 inside
a function meaning that it has local scope. You are then trying to
reference that local object from inside another function (each QxRequest
creates a new function to work in). What I do is to not eval the code
inside the QxRequest code. I create a function that returns the code
back to the main function then eval it there. That way newly created
objects are created at the top level and everything will have access to it.
Jim
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
Qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel