The problem with my code was that i did this:

var page = new qx.ui.tabview.Page("Test");
page.setShowCloseButton(true);

 page.addListener("close", function(e) {
    e.getTarget().destroy();
 }, this);

tabview.add(page);

It appears to be that the page must be added to the tabview *before* adding the event listener. Otherwise I get lots of vague errors (In the playground no errors occurred, but memory is leaking there). Also, when the selected page is closed no other page is selected.

Is it good practice to always add listeners after a object is assigned to a other as child? Or is this a bug or something?

Best regards,
Martijn

Christian Schmidt wrote:
Hi Martijen,

a automatically dispose is in my opinion not correct, because perhaps you will reuse the closed page. If the dispose it automatically you can't reuse it.

To dispose the closed page, you can add a listener to the "close" event and call the destroy method on the page. Here my example, I don't know why it doesn't work with your one:
var page = new qx.ui.tabview.Page("Test");
page.setShowCloseButton(true);
tabview.add(page);

  page.addListener("close", function(e) {
     e.getTarget().destroy();
  }, this);

Cheers,
Chris

Am 04.02.2010 13:58, schrieb Martijn Evers:
Hi,

I am building a application with a tabview widget. When I close a page
the object stays in memory. I've build a little application to show my
point in the playground: http://bit.ly/cR5tW4.

I don't know if this is a bug. Is there anyway to dispose it myself?
Because I already tried by listening to the 'close' event and destroying
the page. But this leads to a lot of errors.

Any thoughts about this?

Best regards,
Martijn

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to