Hi again Marc, the TreeFolder is disposed like you'd expect. The problem is that when you call setContextMenu, the widget attaches a listener to the contextMenu's changeVisibility event. This listener isn't removed when the folder is disposed so if the menu is used for a different item, the event system notices that the original (disposed) folder still has a listener attached and triggers the warning. I've opened a report for this issue:
http://bugzilla.qooxdoo.org/show_bug.cgi?id=5465 Regards, Daniel On 07/29/2011 06:01 PM, Marc Puts wrote: > Hi Daniel, > > Oops! I posted the wrong playground example. > > My original example did not dereference the menu in deleteItem. I added > that later while experimenting, but I still saw the warning so I thought > it wasn't the solution. Now I see that dereferencing before deletion > actually *is* the solution. The example I posted still shows the warning > when you delete a non-leaf node (2.1.1). But that makes sense, because > the menus of the underlying nodes do not get dereferenced, only the > deleted node itself. > > What I don't get though, is *why* I must remove the reference. When I > remove something from the model, I'd expect the controller to dispose > the related tree node. Why would the context menu reference cause > troubles there? > > Regards, > Marc > > > > On 07/29/2011 05:33 PM, Daniel Wagner wrote: >> Hi Marc, >> >> I wasn't able to reproduce the problem using the Playground example. >> You'd get this warning if you didn't remove the reference to the menu >> from the TreeFolder before disposing the corresponding item, but you're >> doing that in deleteItem. I don't get it :( >> >> Regards, >> Daniel >> >> On 07/29/2011 04:43 PM, Marc Puts wrote: >>> Hi guys, >>> >>> I'm using a tree+controller and am attaching different context menu's to >>> the tree items. This is done in the bindItem function of the delegate. >>> There are a few different context menu's, and the menu choice for each >>> tree node is based on some model property. This all works great. >>> >>> But problems come when I remove items from the model. After I delete a >>> node, and right click any other node that shares the same menu instance >>> as the deleted node, I see the following warning in the log: >>> >>> "The context object 'qx.ui.tree.TreeFolder[undefined]' for the event >>> 'changeVisibility' of 'qx.ui.menu.Menu[13846-0]'is already disposed." >>> >>> >>> A somewhat complex playground example: >>> http://tinyurl.com/3nomcc5 >>> * >>> *In the example, all nodes under the same top level folder share the >>> same menu instance (1, 1.1, 1.2 have the same menu; 4, 4.1, 4.2, ... too) >>> * >>> *Reproducing the log warning: >>> 1) Rightclick a node (i.e. node 4.2) and click the delete option. >>> 2) Then rightclick a node that shares the same menu (i.e. node 4.3) and >>> see the warning in the log >>> >>> >>> Does anyone have an idea on how I can solve this? >>> >>> Thanks, >>> Marc >>> >>> ------------------------------------------------------------------------------ >>> Got Input? Slashdot Needs You. >>> Take our quick survey online. Come on, we don't ask for help often. >>> Plus, you'll get a chance to win $100 to spend on ThinkGeek. >>> http://p.sf.net/sfu/slashdot-survey >>> _______________________________________________ >>> qooxdoo-devel mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel >>> >>> >> ------------------------------------------------------------------------------ >> Got Input? Slashdot Needs You. >> Take our quick survey online. Come on, we don't ask for help often. >> Plus, you'll get a chance to win $100 to spend on ThinkGeek. >> http://p.sf.net/sfu/slashdot-survey >> _______________________________________________ >> qooxdoo-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > ------------------------------------------------------------------------------ > Got Input? Slashdot Needs You. > Take our quick survey online. Come on, we don't ask for help often. > Plus, you'll get a chance to win $100 to spend on ThinkGeek. > http://p.sf.net/sfu/slashdot-survey > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > ------------------------------------------------------------------------------ Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get a chance to win $100 to spend on ThinkGeek. http://p.sf.net/sfu/slashdot-survey _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
