On Apr 28, 2:33 pm, Julio Faerman <[email protected]> wrote: > Hi, > > I am trying to implement the "Places" abstraction over the history > service in my GWT MVP app. I am finding it very hard to get it working > with "hierarchical" places ( token=/order/123/item/1 ), because i > would not like to redraw the entire screen ( container.clear() ) when > the place is changed to somewhere near ( token=/order/123/item/2 ), > unless that is required.
In our "places" implementation, we have a HistoryMapper that maps between Place objects and their String representation (used as history tokens). Place objects generally implement or extend a base interface/ class to allow "grouping" based on "instanceof". For instance, the ContactsListPlace and ContactDetailsPlace both extend the abstract ContactRelatedPlace. That way, the top-level controller/presenter works on "instanceof ContactRelatedPlace" to eventually switch to, say, the "Contacts" tab in a TabPanel; the presenter managing the "Contacts" tab then can work on the "instanceof ContactsListPlace" and "instanceof ContactDetailsPlace" to switch between the list and details widgets; and in case of "instanceof ContactDetailsPlace", the ContactDetailsPresenter is also updated so the current contact is eventually replaced with the one from the place (ContactDetailsPlace has a getContactId() accessor) Our previous implementation (before Ray came with the "Places" concept last year; and before we started using MVP: everything was a Composite) worked on strings: split the token on the first "/" and work on the first part, then give the second part down to the appropriate widget, rince and repeat. -- 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.
