> Just that your ActivityMapper would probably return the very same Activity
> instance, so the activity isn't "re started" as a result of navigation
> between pages.

please refer to the sample code below [1], which is used to put this
post into context.

"They would still be distinct Place instances"
yes, therefore as we go from one place to the next,
(going from ListEmployeePlace(4) to ListEmployeePlace(5))
we are going to a new Place, which results in ActivityMapper
attempting
to find the correct Activity for this place, and the ActivityMapper,
creates a "New" ListEmployeeActivity
every time " return new ListEmployeeActivity(listPage.getPageNumber);"

here we are returning a "New EmployeeListActivity" everytime.
when a New Activity is returned, the corresponding ActivityManager,
invokes "start" method on it.
which contradicts with "so the activity isn't re started".

how can the behaviour you described be achieved ?

"Just that your ActivityMapper would probably return the very same
Activity
instance, so the activity isn't "re started" as a result of navigation
between pages."

by returning the "same activity instance", do we need to use
Provider<ListEmployeeActivity> listEmployeeActivity;
and bind this provider in Singleton scope ?

then what about GWT Activity philosophy that Activities are to be
discarded, that they are not singletons ?
and AbstractActivity's onStop method, would stop the current activity
ListEmployeeActivity(4),
when it is stopped how can it NOT be restarted when in
ListEmployeePlace(5)?

you mentioned activity "isn't re started",
but as a result of going to a new Place, (from ListEmployeePlace(4) to
ListEmployeePlace(5)),
onStop method causes the Activity to stop.
do we need to make the onStop to do nothing, a method with empty
body ?
implementing Activity directly, isntead of extending AbstractActivity?

Thank You

[1] sample code

//List Employee Place
public class ListEmployeePlace extends Place {

int pageNumber;

     public ListEmployeePlace(int pageNumber){
               this.pageNumber = pageNumber;
     }

int getPageNumber(){return this.pageNumber;}

}

//our Main ActivityMapper
public class MainActivityMapper implements ActivityMapper {

Activity getActivity(Place place){

      if(place instanceof ListEmployeePlace){
         ListEmployeePlace listPlace = (ListEmployeePlace) place;
          return new ListEmployeeActivity(listPage.getPageNumber());
      }
}

}

-- 
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