Aw: Re: Aw: Re: Aw: Re: Question about new activities on place changes
Ok a Custom CachingActivityMapper was easy to implement and works but there is still a case I am not happy with. If a user bookmarks EmployeePlace(1,123) and 123 gets deleted the activity would redirect to EmployeePlace(1, null) to keep the URL in sync (activity can not preselect the deleted item). But now the user could hit the browsers back button and is back on the URL for EmployeePlace(1,123). But as my activity now does not get notified (its cached and no start or setPlace is called) it can not redirect again to EmployeePlace(1, null). Thus nothing would be selected but the URL would imply that something should be selected. So as I can not recreate the activity (the list would reload) the only way to solve this problem would be to call setPlace on the cached activity each time the place changes and let the activity react. But this is the same thing I would do if my activities were singletons. The only difference is that now I have only one variable storing the last activity (vs. all activities being singletons which would need a bit more memory). -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/55xlM-38tfsJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Aw: Re: Aw: Re: Aw: Re: Question about new activities on place changes
Because you activity lasts longer than a place, it should listen to PlaceChangeEvent (as if it were a singleton, except that it can be garbage collected and will be recreated if you go to another activity in the mean time), or the ActivityMapper should update it with the new place. But actually, I wouldn't do a redirect if I were you. I'd rather either do as if there was no id in the place (despite being one in the URL) or display an error message that the request employee (or whatever) doesn't exist. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Gv_o8tY1xOoJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Aw: Re: Aw: Re: Aw: Re: Question about new activities on place changes
Yeah its a migration to activities and for simplicity I have only defined a single display area. Thats somehow the work area of the app. The reason is that I have a custom widget (layout panel) that can do quite a lot of things. So for each place I have that custom widget that effectively wraps a list selection, toolbar and the real content area and that widget goes into the display area associated with my activity manager. So my Activity has to handle both: list selection and loading the selected item. I have thought about removing the list out of that widget and instead create a separate display area/activity for it.. but that would result in to much refactoring for an initial migration to activities as that custom widget is used everywhere in the app. Well and I haven't had a clue that not doing so would lead to the problems I now have :) If I would have two separate display areas, only the one displaying the list selection would need that place filtering/caching, right? I'll take a look at a custom CachingActivityMapper.. we'll see. --J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/CZR_e8KQoxcJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.