Is there really no comments on this? Am I doing something wrong or does GWT handle events this way. Doesn't seem right that I have to handle everything in the DockPresenter. Could someone please point me in the right direction
Thanks A On 9 Juli, 14:43, xworker <[email protected]> wrote: > Hi all. > > Got this setup: > > Dock (DockLayoutPanel) > --Tree (Tree) > --Content. (SimplePanel) > > DockPresenter creates and bind the presenters for tree and content > like so: > > public DockPresenter(ContactsServiceAsync rpcService, > HandlerManager eventBus, Display view) { > this.rpcService = rpcService; > this.eventBus = eventBus; > this.display = view; > > contactsPresenter = new ContactsPresenter(rpcService, > eventBus, > new ContactsView()); > treePresenter = new TreePresenter(rpcService, eventBus, new > MyTree()); > } > > Then in the bind method in the DockPresenter i got this: > > public void bind() { > contactsPresenter.bind(); > treePresenter.bind(); > > eventBus.addHandler(SelectionEvent.getType(), treePresenter); > > I want to propagate all the Selection events to the treePresenter. The > treePresenter looks like this: > > public class TreePresenter implements Presenter, > SelectionHandler<TreeItem> { > > ... > ... > > @Override > public void onSelection(SelectionEvent<TreeItem> event) { > TreeItem item = (TreeItem) event.getSelectedItem(); > ... > .. > > } > > But the onSelection method never gets called. Have I misunderstod the > MVP event model? I dont want to handle all event in the dock > presenter, then everyting gets tangeld upp and not very decoupled. > What is the proposed way to handle events in a setup with nestled > presenter and containers widgets containing other widgets? > > It seems that an good example with MVP ui:binding and DockLayoutPanel > (or similar) with a tree navigation to the west which changes content > in the center panel would benefit alot of people. > > Thanks for your time > /Andreas -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
