Re: Passing an argument to a View using Activities and Places

2011-10-08 Thread Mike Dee
Jens, Allison, Yes, I see my problem. I even used the GWT MVP View wizard to create the Place, Activity, and View. It very nicely generates template classes - with the FooPlace.setName(). I must have deleted the method in FooPlace at some point. Thanks, Mike On Oct 6, 1:38 pm, Jens

Passing an argument to a View using Activities and Places

2011-10-06 Thread Mike Dee
I'm using Activities and Place and can't figure this out. I've been looking at samples but don't see it in there. I think I'm missing something. I have a button in one place that, when clicked, will trigger a new activity and place (along with a new view). The code for that button simply looks

Re: Passing an argument to a View using Activities and Places

2011-10-06 Thread Mike Dee
Just want to add one thing. FooView has a method named setName(), which (I think) is used to set the argument. I've noticed this is not called, even though it is passed in creating the FooPlace. On Oct 6, 10:17 am, Mike Dee mdichiapp...@gmail.com wrote: I'm using Activities and Place and can't

Re: Passing an argument to a View using Activities and Places

2011-10-06 Thread Alisson Prestes
The FooActivity extracts the arguments from the FooPlace. Then it calls the right method in the FooView. Place and View do not interact with each other directly. Alisson Prestes www.google.com/profiles/javalisson On Thu, Oct 6, 2011 at 2:17 PM, Mike Dee mdichiapp...@gmail.com wrote: I'm

Re: Passing an argument to a View using Activities and Places

2011-10-06 Thread Mike Dee
So, should I put code in FooActivity? I am not sure if the boilerplate code generated by the activity should have done that or not. On Oct 6, 10:44 am, Alisson Prestes javalis...@gmail.com wrote: The FooActivity extracts the arguments from the FooPlace. Then it calls the right method in the

Re: Passing an argument to a View using Activities and Places

2011-10-06 Thread Mike Dee
Would the call to set the arg in the view go in FooActivity.start()? On Oct 6, 10:46 am, Mike Dee mdichiapp...@gmail.com wrote: So, should I put code in FooActivity?  I am not sure if the boilerplate code generated by the activity should have done that or not. On Oct 6, 10:44 am, Alisson

Re: Passing an argument to a View using Activities and Places

2011-10-06 Thread Alisson Prestes
Yes, I think this will work. Alisson Prestes www.google.com/profiles/javalisson On Thu, Oct 6, 2011 at 2:48 PM, Mike Dee mdichiapp...@gmail.com wrote: Would the call to set the arg in the view go in FooActivity.start()? On Oct 6, 10:46 am, Mike Dee mdichiapp...@gmail.com wrote: So,

Re: Passing an argument to a View using Activities and Places

2011-10-06 Thread Mike Dee
FooActivity.start() looks like this. Note that while it can get FooView from the clientfactory, it has no notion of FooPlace, which is where the argument (fooid) is stored. @Override public void start( AcceptsOneWidget containerWidget, EventBus eventBus ) { FooView view =

Re: Passing an argument to a View using Activities and Places

2011-10-06 Thread Alisson Prestes
Here's an example from GWT Development with Activities and Places tutorial ( http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html ) public class HelloPlace extends Place { private String helloName; public HelloPlace(String token) { this.helloName =

Re: Passing an argument to a View using Activities and Places

2011-10-06 Thread Jens
Your FooPlace should have a getter method to return the stored id. In your ActivityMapper you create an activity for a given place. When you create your activity you can pass the place into its constructor or via a separate setPlace(Place place) method. Your activity would then call the getter