Hey,
I'm trying to create a metamodel editor GUI for a project of mine, and been playing with the history support to make sure back/forward buttons work, which worked fine. I also added a CellClickHandler to do stuff when I select nodes in the tree, and updated my editor GUI in that handler. To support history though, I wanted the possibility to both expand the selected node, and select (click) it, so that the same ClickHandler would be used. This didn't work out (I didn't find an obvious way to do that from the TreeGrid/Tree api). So I ended up using a SelectionChangedHandler, and history change listener does something like that:
My problem here is that the SelectionChangedHandler intercepts deselectAllRecords() (as well as fires multiple times if I do selectSingleRecord(), I assume it essentially deselects all and selects one), so I need the processing flag to enable/disable my SelectionChangedHandler.
I am pretty sure I'm missing something obvious - could you please point me in the right direction, what's the best handler to use in such a situation?
regards,
Andrius
I'm trying to create a metamodel editor GUI for a project of mine, and been playing with the history support to make sure back/forward buttons work, which worked fine. I also added a CellClickHandler to do stuff when I select nodes in the tree, and updated my editor GUI in that handler. To support history though, I wanted the possibility to both expand the selected node, and select (click) it, so that the same ClickHandler would be used. This didn't work out (I didn't find an obvious way to do that from the TreeGrid/Tree api). So I ended up using a SelectionChangedHandler, and history change listener does something like that:
Code:
this.processSelectHandler = false; attributeTypes.deselectAllRecords(); this.processSelectHandler = true; attributeTypes.selectRecord(record);
I am pretty sure I'm missing something obvious - could you please point me in the right direction, what's the best handler to use in such a situation?
regards,
Andrius
Comment