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 help me.
>
> The application has one activity mapper that holds providers (GIN) of
> activity proxies (code splitting) and creates new, clean activity instances
> in its getActivity method. After creation it sets the current place. So
> pretty standard stuff I think.
>
> Now I have for example an EmployeePlace that has two variables: 1.) the
> employer id, 2.) the employee id. The view for that place contains a list
> and a content area for the selected employee's details. So my
> EmployeeActivity uses the employer id to fetch & fill the list of
> employees and the employee id for an optional pre-selection.
>
> My problem is that when I select something in the employee list I do a 
> placeController.goTo(new
> EmployeePlace(currentEmployerId, selectedEmployeeId)) so that the history
> token reflects the current selection. But as I always create new activities
> the whole mechanism starts again and for each selection in my list the
> activity fetches all employees, fills the list and pre-selects the employee.
> So it doesn't feel right (loading overlay for the list on selection) and
> creates a lot of network communication overhead.
>
> So is there a way to update the URL history token and NOT changing the
> place so that the activity not gets restarted?
>
> I have tried to implement hashcode() and equals() in the EmployeePlace in
> a way that two places are equal once the employer ids are equal. That way
> the activity does not get recreated and started if the employee id changes
> but the URL does not reflect the list selection and
> placeController.getWhere() returns a place with no employee id (basically
> the "old" place prior selection)
>
> Is there a way to solve this? I think I clearly missing something. Seems
> like a standard use case and currently I have no real idea how it can work
> without singleton activities.
>
> Thanks 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/-/l0nnHzqQrhcJ.
> 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.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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.

Reply via email to