GWT Propagate Event on views in activties -
how throw view event, such click on button, in view's activty? view doesn't know activity eventbus.. miss something? i'm using 2.3 sdk
thanks
i think best option keep reference activity in view , forward event activity, can use eventbus in it's own method.
there small example on page: http://code.google.com/intl/sv-se/webtoolkit/doc/latest/devguidemvpactivitiesandplaces.html
but basically, use @uihandler handle clickevent, , invoke method in activity. in activity perform action uses eventbus, rpc, or so. know people prefer handling event directly in activity me seems nicer separation of concern , keeps view nicely "stupid".
an example:
button says "select active customer"
view handles clickevent button, invokes presenter.customerselected(...)
activity has customerselected method , creates activecustomerselectedevent, sends on eventbus.
Comments
Post a Comment