Jim Hunter schrieb: > I can't really update the children because I am never sure what the new > children are going to consist of. The pages are dynamic, loaded from a > database. The pages are under full control of the user, I never know > what they will contain. When moving from one row in a recordset to the > next, the page might have the exact same controls with different values, > or they might be a completely different set of controls with the only > constant being the VerticalBoxLayout that contains them. > Making a demo is going to be next to impossible. I'll keep digging in to > see if there is some sort of scoping issue that is going on where I am > calling removeAll() on the wrong object or ?????
Maybe. removeAll() should generally work. But maybe it's also a bug somewhere in qooxdoo in some situations. Ever tried a simpler example/test? > > What about the disposeChildren() function? Should something like that > work? Do I need to ad a remove() to the mix? Will I need to set the > object reference to null? Is that function totally unnecessary? There is maybe an error in your function. You should copy the children array. Otherwise it will get dynamically updates through the dispose you execute. Please try: qx.lang.Array.copy I would suggest to first remove and then dispose: c[x].setParent(null); c[x].dispose(); Cheers, Sebastian > > thanks, > Jim > > On 8/1/06, *Sebastian Werner* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Jim Hunter schrieb: > > > > Since dispose doesn't free up memory, what is the official qooxdoo > > recommended way to completely get rid of an object? I am running > into a > > situation where I have a VerticalBoxLayout that I put a bunch of > named > > controls on. Later I need to replace those controls with a new set of > > controls, problem is that they have the same names. I have tried > to do a > > removeAll() on the VerticalBoxLayout then created new controls, > added > > them to the layout but all of the previous controls still show. I > have > > even tried to iterate through all of the child controls of the > > VerticalBoxLayout and dispose of them and their children but I > still get > > them. I need to be able to remove them from the DOM or at least > remove > > them from the internal list of widgets that qooxdoo keeps. > > remove and removeAll should definitely work. There are examples (in > test) which shows this. And it's working. Maybe a *small* example would > be helpful. > > What's about to update the children instead of re-create them? > > Sebastian > > > The scenario that the new controls have the same names as the > previous > > ones is a situation that I can not change. I tried to create a method > > that would get rid of all children of an object, but it didn't work, > > Here is what I created, please let me know what needs to be > changed with > > the code to make it work: > > > > qx.ui.core.Parent.prototype.disposeChildren = function() > > { > > // this will cycle through all children and call > disposeChildren on each > > // it will then dispose that child > > var c = this.getChildren(); > > for (var x=0;x<c.length;x++) > > { > > c[x].disposeChildren(); > > //c[x].dispose(); // moved this to after the loop > > } > > // I even tried it this way as well > > // if (c.length > 0) > > // { > > // this.forEachChild(function(o){ > > // o.disposeChildren(); > > // }); > > } > > this.dispose(); > > } > > > > > > My thought was that all I would need to do is call > > object.disposeChildren() and it would dispose all it's children then > > dispose itself. I created a routine similar to this when I was > working > > with ActiveWidgets and it worked well there. > > > > Thanks, > > Jim > > > > > > ============From another thread============== > > > > Please remember however that "dispose" isn't a memory management > tool. > > To just dispose doesn't free up memory. This means that long-running > > application could be problematic (these applications generally > creates > > even more objects while running: events, io-stuff, tooltips, > ...). Just > > dispose them, doesn't free up memory. So it will increase over the > > runtime of the application. This is just normal I think. > > > > Sebastian > > > > > > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------- > > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > > opinions on IT & business topics through brief surveys -- and > earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > > > > > > > ------------------------------------------------------------------------ > > > > > _______________________________________________ > > qooxdoo-devel mailing list > > [email protected] > <mailto:[email protected]> > > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net 's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > <mailto:[email protected]> > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
