Hi Rickard, first of all, welcome to qooxdoo! :)
Yes, writing your own controller would be the way to go. We do have some default controllers but non for the virtual gallery widget. A first hint: As you can imagine because the code of the gallery is in a demo, the widgets is far from stable so please keep that in mind. If you plan to use your own copy of the gallery, its quite fine to use that code. :) The first step for implementing the controller would be to create the direction from the tree selection to the gallery widget. Did you use a tree controller to fill the tree? If yes, the controller has a selection array where you can start. I have some code in mind how it could look at the end: var galleryController = new galleryController(treeController.getSelection(), gallery); // model, target The controller has to take care of the changes of his model (the tree selection). Luckily this is a data array so you can listen to its 'change' and 'changeLenght' event. That way, it should not be too hard to code that direction. The other direction could be a bit more challenging. You have to listen to the selection changes of the gallery and change the selection of the tree controller (not the tree) on changes. But keep in mind that the selection changes of the tree changes the selection of the gallery as well so you can get easily into a dead lock situation. You probably will need some kind of lock to prevent dead locks situations. I hope my few ideas can get you started. It would be interesting the get to know you progress during your implementation. So maybe you can give some feedback from time to time how it is going. And feel free to ask if you have some kind of questions. Best, Martin Rickard Claeson wrote: > > Hi there! > > I'm totaly new too qooxdoo so please, bear with me. > > I have created a horizontal pane. > On the left side I have added a Tree (loaded with a store). > On the right side I have added a Gallery (composite container). > > The Gallery I've taken from the Demo ( > http://demo.qooxdoo.org/devel/demobrowser/#virtual~Gallery.html) but > changed > it to extend from qx.ui.container.Composite instead. > > Everything works fine but now I need to bind the Tree to the Gallery. The > initial gallery items should be created depending on the tree root > content. > When ever the user selects a parent folder in the tree the subfolders > should > be visible in the gallery. > I also want it to work the other way, if the user clicks a parent folder > inside the Gallery, the same folder in the tree should be selected and > expanded. > > Am I supposed to create a new controller class for the gallery to do this > or > is there an easier/better way? > > > Greatful for all help I can get. > //Rickard > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > qooxdoo-devel mailing list > qooxdoo-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > -- View this message in context: http://n2.nabble.com/Bind-tree-controller-to-a-composite-container-tp4255140p4255448.html Sent from the qooxdoo mailing list archive at Nabble.com. ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel