Re: Aw: Re: Question about new activities on place changes

2011-06-27 Thread tanteanni
thx to all 3 of you! my very little example is now working (is there a place to upload examples? it is nice to understand activities and places without MVP) placeController.getWhere() is the essence that made it clear for me. thats the place the comparison uses with the place given to goTo,

Aw: Re: Aw: Re: Question about new activities on place changes

2011-06-27 Thread Jens
Oh yeah small typo in my MainActivityMapper example. It has to be: if(place instanceof XYZPlace) { this.lastActivity = new XYZActivity(place); return this.lastActivity; } else if() {.} . So its just implemented as a field that stores the activity. Nothing fancy ;-) -- J.

Re: Aw: Re: Aw: Re: Question about new activities on place changes

2011-06-27 Thread tanteanni
thx that's realy nice - on first sight much better than filtering/caching/overriding equal just to get the same as before. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit

Re: Question about new activities on place changes

2011-06-24 Thread tanteanni
Thomas/Jens. ... and the CachingActivityMapper will then return the same activity instance as previously ... how to achieve that? i am able to create caching/filtered mapper but Filter returns a place and all my mappers are returning new activities? How to get / hold the old activity without

Re: Question about new activities on place changes

2011-06-24 Thread Juan Pablo Gardella
Are you use gin? 2011/6/24 tanteanni tantea...@hotmail.com Thomas/Jens. ... and the CachingActivityMapper will then return the same activity instance as previously ... how to achieve that? i am able to create caching/filtered mapper but Filter returns a place and all my mappers are

Re: Question about new activities on place changes

2011-06-24 Thread tanteanni
no -- 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/-/qzqZyEaSCPkJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To

Re: Question about new activities on place changes

2011-06-24 Thread Thomas Broyer
The common pattern is ActivityManager → FilteredActivityMapper → CachingActivityMapper → MyActivityMapper. The FilteredActivityMapper's Filter transforms places to common cases that can be compared with .equals(). In a Spring Roo app (at least of the kind that came with the first version of

Re: Question about new activities on place changes

2011-06-24 Thread tanteanni
i didn't understand much thomas - sorry. in meantime i wrote a little sandbox app to boil my problem down to a minimum amount of code. My Problem is either i didn't understand anything or CachingActivityMapper is a misleading term because where is the cache and the cached activity. All i got

Re: Question about new activities on place changes

2011-06-24 Thread Thomas Broyer
FilteredActivityMapper and CachingActivityMapper are the one from gwt-user.jar, you only have to write a FilteredActivityMapper.Filter to transform places, and an ActivityMapper which will provide the activities (the one I called MyActivityMapper in my previous message). Mauro replied a few

Re: Question about new activities on place changes

2011-06-24 Thread tanteanni
ok thats clear enough but there is my problem: providing an activity mapper that returns a cached activity. how does such an getActivity -method looks like (my only idea is to return an activity saved in some global field). but i can't believe that CachingActivityMapper could provide a cached

Re: Question about new activities on place changes

2011-06-24 Thread Thomas Broyer
On Friday, June 24, 2011 3:52:08 PM UTC+2, tanteanni wrote: ok thats clear enough but there is my problem: providing an activity mapper that returns a cached activity. how does such an getActivity -method looks like (my only idea is to return an activity saved in some global field). but

Re: Question about new activities on place changes

2011-06-24 Thread tanteanni
thx thomas for your never ending endurance, i guess i came a little closer after reading the source. Sorry for that: But what is the value of lastPlace and lastActivity after construction time? And i miss the connection with Mauro's current code: If His CachingMApper returns new

Re: Question about new activities on place changes

2011-06-24 Thread Mauro Bertapelle
On Jun 24, 4:44 pm, tanteanni tantea...@hotmail.com wrote: thx thomas for your never ending endurance, i guess i came a little closer after reading the source. Sorry for that: But what is the value of lastPlace and lastActivity after construction time? both null, of course.. And i miss

Aw: Re: Question about new activities on place changes

2011-06-24 Thread Jens
Its pretty easy. If you have looked at the source code of CachingActivityMapper you see that it only calls place.equals(lastPlace) to check if it has to return the previous activity or has to create a new one. After construction of CachingActivityMapper both lastPlace and lastActivity are null

Aw: Re: Aw: Re: Aw: Re: Question about new activities on place changes

2011-06-17 Thread Jens
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

Re: Aw: Re: Aw: Re: Aw: Re: Question about new activities on place changes

2011-06-17 Thread Thomas Broyer
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

Aw: Re: Question about new activities on place changes

2011-06-16 Thread Jens
In that case I do not wanna cache things on client side. The app should be smart enough that it doesn't try to reload the list each time a list item is selected. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on

Re: Question about new activities on place changes

2011-06-16 Thread Thomas Broyer
Instead of changing the equality behavior of your place, you should instead put your list activity mapper behind a FilteredActivityMapper and CachingActivityMapper: the FilteredActivityMapper will convert an EmployeePlace(empyer, employee) into, say, an EmployeePlace(employer, null), and the

Aw: Re: Question about new activities on place changes

2011-06-16 Thread Jens
Thanks I will try that. Haven't thought of a FilteredActivityMapper. I already tried a CachingActivityMapper on its own and because of the equality stuff it doesn't work. I have just went through some examples but the layoutmvp example posted in this group also has an activity that starts over

Re: Aw: Re: Question about new activities on place changes

2011-06-16 Thread Thomas Broyer
It must have been in an earlier version. It's still in the bikeshed's Scaffold app (thus probably in any app generated by Spring Roo btw) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit

Aw: Re: Aw: Re: Question about new activities on place changes

2011-06-16 Thread Jens
Hm I have tried it now and at least the activity does not get restarted. But now if I bookmark my selected employee and access it later it can not be reselected because the activity filter always sets the employee id to null. The filter can not distinguish if the app is running and the user

Re: Aw: Re: Aw: Re: Question about new activities on place changes

2011-06-16 Thread Thomas Broyer
Oh, so you have a single activity handling both the master and details? In that case, then I'd probably implement the caching by hand in the ActivityMapper (or in your own proxy activity mapper, inspired by CachingActivityMapper but doing the comparison using a more sofisticated approach than

Aw: Re: Aw: Re: Aw: Re: Question about new activities on place changes

2011-06-16 Thread Jens
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

Question about new activities on place changes

2011-06-15 Thread Jens
Hi, I just integrating activities and got stuck when it comes to list selections. Hopefully someone with more practically experience can help me. The application has one activity mapper that holds providers (GIN) of activity proxies (code splitting) and creates new, clean activity instances

Re: Question about new activities on place changes

2011-06-15 Thread Juan Pablo Gardella
I think you can use a singleton in client side to manage getEmployesOf(employer). You can cache the last query. 2011/6/15 Jens jens.nehlme...@gmail.com Hi, I just integrating activities and got stuck when it comes to list selections. Hopefully someone with more practically experience can