Hi Dietrich,

I think you're close. The typical .remove() method really means that, 
remove the child widget from the parent control. But nothing is 
destroyed as there might be further references to the child that are 
still alive. When the parent is disposed it calls _disposeChildControl 
(via Widget), which in turn calls .destroy. So I figure 
_disposeChildControl should suffice in your context, in order to avoid 
leaks.

I guess the automatic handling of childControls is more geared towards 
compound controls where the child controls have the same life cycle as 
the parent. If you decouple the life cycles then it's hard to know for 
the compound control if you intend to further work with removed child or 
not, and you have to do the cleanup yourself. If you can think of a nice 
API for this (e.g. an optional parameter to .remove()), feel free to 
open a bug for it.

T.

On 10/24/2012 04:24 PM, Dietrich Streifert wrote:
> Hello everybody!
>
> I've created a control containing a qx.ui.table.Table where the the
> control uses the childControl mechanism to create the table as a child
> by overwriting _createChildControlImpl in the control.
>
> In some situation I want to be able to change the column model of the
> table which is not possible with the already initialized table instance.
> So I have to destruct/dispose/remove the table child control and
> recreate the table instance with the new table column model.
>
> The problem is that there is no interface (no methods) which allow the
> re-creation or removal of a child control from its parent.
>
> As every widget inherits from qx.ui.core.Widget I'm able to call the
> inherited method _disposeChildControls which disposes all child controls.
>
> With this and by calling the following methods
>
>       control.remove(table);
>       control._disposeChildControls();
>       table.destroy();
>
> I'm able to recreate the table while everything is working as expected,
> but it does not "feel" like the right way to do it.
>
> Is there a more "official" way to do this?
>
> Any help would be great.
>
> Regards
> Dietrich
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to