How to change the panel in Activity.start()

13 views
Skip to first unread message

Julio Faerman

unread,
Nov 11, 2010, 7:24:59 PM11/11/10
to Google Web Toolkit
I want to start one activity (my form) inside another (my app). I am
trying to do that with the 2.1 MVP Framwork and would like to know...

1) Is it possible to configure the ActivityManager (or add place
parameter) so that my FormActivity.start() receives a inner panel of
my app instead of the outer one set by
activityManager.setDisplay(appWidget) when the EntryPoint was loaded?

2) The documentation reads "your app could create a CompositePlace,
CompositeActivity, and CompositePlace.Tokenizer classes that delegate
to the constituent members". Have anyone implemented that? (and would
be kind enough to share)

3) Is there another way or recommended practice?

Thanks,
Julio

Thomas Broyer

unread,
Nov 12, 2010, 10:23:48 AM11/12/10
to Google Web Toolkit


On 12 nov, 01:24, Julio Faerman <jfaer...@gmail.com> wrote:
> I want to start one activity (my form) inside another (my app). I am
> trying to do that with the 2.1 MVP Framwork and would like to know...
>
> 1) Is it possible to configure the ActivityManager (or add place
> parameter) so that my FormActivity.start() receives a inner panel of
> my app instead of the outer one set by
> activityManager.setDisplay(appWidget) when the EntryPoint was loaded?

No.

> 2) The documentation reads "your app could create a CompositePlace,
> CompositeActivity, and CompositePlace.Tokenizer classes that delegate
> to the constituent members". Have anyone implemented that? (and would
> be kind enough to share)

We did create something similar to a "composite activity" (for a
"dashboard"). The idea is to *not* use an ActivityManager for these
inner parts, but manage your "sub activities" lifecycle "by hand".
In retrospect though, I don't think using the Activity interface for
our "dashlets" really brings us anything; we are nesting what I call
"MVP components", but not really "activities" (the dashboard is the
activity).

> 3) Is there another way or recommended practice?

I'd recommend reading http://tbroyer.posterous.com/gwt-21-activities-nesting-yagni

Another approach could be that your "inner activity" isn't an "inner",
but rather an "outer", which shares some code with your current "outer
activity" (i.e. the FormActivity doesn't start *within* the other, but
it *replaces* it, just like any activity, and reuses part of its view,
and maybe part of its presentation logic too)

(you can also wait a bit and see what GWT-P developers will
propose ;-) )

PhilBeaudoin

unread,
Nov 12, 2010, 2:23:46 PM11/12/10
to Google Web Toolkit
Thanks Thomas for preempting me. Next time I'll try to be faster than
you and conclude with "you can also wait a bit and see what Thomas
will propose". ;)

That being said, I believe it's important to point out that there are
two point of views with respect to that problem. Some think nesting
presenters and cascading their lifecycle methods is never required --
that's the opinion of Thomas and the design team behind GWT 2.1 MVP.
(Although I see you had to work around the problem somehow.) Others
have been using nested presenters for a while and believe they make
development easier -- that's the opinion of the GWTP design team. If
you'd like to see the counterpoint opinion I invite you to read
Thomas' blog post and then the following GWTP wiki page:
http://code.google.com/p/gwt-platform/wiki/ComparisonWithGwtMVP

Cheers,

Philippe

On Nov 12, 7:23 am, Thomas Broyer <t.bro...@gmail.com> wrote:
> On 12 nov, 01:24, Julio Faerman <jfaer...@gmail.com> wrote:
>
> > I want to start one activity (my form) inside another (my app). I am
> > trying to do that with the 2.1 MVP Framwork and would like to know...
>
> > 1) Is it possible to configure the ActivityManager (or add place
> > parameter) so that my FormActivity.start() receives a inner panel of
> > my app instead of the outer one set by
> > activityManager.setDisplay(appWidget) when the EntryPoint was loaded?
>
> No.
>
> > 2) The documentation reads "your app could create a CompositePlace,
> > CompositeActivity, and CompositePlace.Tokenizer classes that delegate
> > to the constituent members". Have anyone implemented that? (and would
> > be kind enough to share)
>
> We did create something similar to a "composite activity" (for a
> "dashboard"). The idea is to *not* use an ActivityManager for these
> inner parts, but manage your "sub activities" lifecycle "by hand".
> In retrospect though, I don't think using the Activity interface for
> our "dashlets" really brings us anything; we are nesting what I call
> "MVP components", but not really "activities" (the dashboard is the
> activity).
>
> > 3) Is there another way or recommended practice?
>
> I'd recommend readinghttp://tbroyer.posterous.com/gwt-21-activities-nesting-yagni

Thomas Broyer

unread,
Nov 12, 2010, 6:13:25 PM11/12/10
to Google Web Toolkit


On 12 nov, 20:23, PhilBeaudoin <philippe.beaud...@gmail.com> wrote:
> Thanks Thomas for preempting me. Next time I'll try to be faster than
> you and conclude with "you can also wait a bit and see what Thomas
> will propose". ;)
>
> That being said, I believe it's important to point out that there are
> two point of views with respect to that problem. Some think nesting
> presenters and cascading their lifecycle methods is never required --
> that's the opinion of Thomas and the design team behind GWT 2.1 MVP.
> (Although I see you had to work around the problem somehow.) Others
> have been using nested presenters for a while and believe they make
> development easier -- that's the opinion of the GWTP design team.

Actually, I believe we should strongly try to disconnect activities
from MVP: Activities don't force you to do MVP, and you'll use MVP
beyond Activities.
I totally agree that nesting "presenters" (I call them "MVP
components") is needed in (almost) every application; but that doesn't
mean you have to nest activities.
And nothing in GWT proper tries to do anything to solve the issue of
nesting "presenters" (there's absolutely nothing in GWT proper related
to MVP actually; I refuse to call Activities an "MVP framework", it
has nothing to do with MVP in my opinion)
This leaves a lot of room for frameworks like GWT-P to go beyond
navigation (Places and Activities) and more into MVP.

> If you'd like to see the counterpoint opinion I invite you to read
> Thomas' blog post and then the following GWTP wiki page:
> http://code.google.com/p/gwt-platform/wiki/ComparisonWithGwtMVP

I admit I haven't yet read it thoroughly, but my analysis (from the
little I know about GWT-P) would be that GWT 2.1 strongly decouples
navigation (places) from activities (things the user will do, through
activity mapper) from "view composition" (activities within
AcceptsOneWidget) from browser's history integration (place history
handler/mapper); whereas it's more "blurry" in GWT-P (it's even more
the case in Mvp4g AFAICT), where the "activity" tells "the framework"
when (as a result of some event dispatched on the bus) and where
(which "slot") it should be revealed.

Given my inexistent experience with GWT-P (I only read docs and
samples' code), I can very well be wrong though! And things being more
"blurry" is not necessarily a bad thing in practice (not my opinion
but YMMV); I mean, please do not read the above as criticisms; I'm by
no mean saying that GWT-P is a bad framework (quite the contrary, it
has a lot of traction, which to me is a sign).

Christian Goudreau

unread,
Nov 12, 2010, 11:24:56 PM11/12/10
to google-we...@googlegroups.com
Maybe it's a night call, but, when will we have a nice "meeting (Google IO 2011 ?)" and talk about this for real ? :D

Cheers,


--
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-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.




--
Christian Goudreau

Thomas Broyer

unread,
Nov 13, 2010, 10:29:26 AM11/13/10
to Google Web Toolkit


On 13 nov, 05:24, Christian Goudreau <goudreau.christ...@gmail.com>
wrote:
> Maybe it's a night call, but, when will we have a nice "meeting (Google IO
> 2011 ?)" and talk about this for real ? :D

My employer seems to want to communicate more on our GWT skills (see,
I'm translating my GWT 2.1 articles to French: http://blog.atolcd.com
), so maybe I'll make it to I/O this time (he was OK last year but it
was me who couldn't).
It'd be way cool to have a F2F then, sure!

(otherwise, huh, there's 9 hours between Vancouver and Dijon,France
timezones!)

PhilBeaudoin

unread,
Nov 13, 2010, 10:43:53 PM11/13/10
to Google Web Toolkit
In french, très bien! :)

Yes, let's try to meet at some point. I always enjoy reading your
thoughtful articles and replies. I'm sure there would be a lot of
value in exchanging F2F. In fact, I never even met Christian! There
are also quite a few people on Guice, GIN, MVP4G and GUIT that I'd
like to meet.

Ah, and let's invite Ray Ryan too. ;)

Cheers,

Philippe
Reply all
Reply to author
Forward
0 new messages