On 4/20/10 3:06 AM, MartinWittemann wrote: > Hello Greg, > I took a look at your example but I really cold not figure out whats > happening here. Sorry! > But if you say that cloning the reference helps, then someone dispose the > former model. Or... do you rely on the changeModel event? Maybe thats the > clue! > I was not relying on this event, no. The code you see is the exact code I use. The only thing I removed was the other irrelevant tabs in the tabview from the application, and of course I replaced the remote json request with a local model creation from json. > But the code raised some questions. Why are model and UI elements the same? > If you split up model and UI, you have a hand full of advantages like > reusing the data for other kind of views or just working with the model and > not taking care about the UI. > ?? The model is separate from the UI. The track/album/category classes are UI elements (they extend TreeFolder or TreeItem) and they manipulate the model only in order to implement drag/drop. The model is stored separately in the class created by the json marshaller.
Having said that, I've been following the discussion about adding tree folders, and I am actually going to refactor to implement it that way, it looks a whole heck of a lot simpler to manage. I'll just need to write a delegate for the data marshaller so it creates the proper classes as models. My hope is that I'll be able to implement the drag/drop by manipulating the controller instead of the model, which should fix the object freeing issue (hopefully). Greg ------------------------------------------------------------------------------ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel