rootpanel problem

4 views
Skip to first unread message

Vladislavs Serebro

unread,
Aug 18, 2010, 7:33:09 AM8/18/10
to Mvp4g
HI,

i currently ported my project from mvp4g 1.0 to mvp4g 1.1.0 but i
still have the following problem :

this code doesn't work anymore

RootPanel.get("main").add(view.getViewWidget());

All widgets are displayed in the way they are supposed to and the
eventbus works also,
but everything is misplaced.

someone any ideas?

Best Regards


Vladislavs Serebro

unread,
Aug 18, 2010, 8:32:54 AM8/18/10
to Mvp4g
hi all,

it seems like it's an gwt-2.1.0-M2 problem
http://code.google.com/p/google-web-toolkit/issues/detail?id=4532

best regards

Vladislavs Serebro

unread,
Aug 18, 2010, 10:57:03 AM8/18/10
to Mvp4g
Dear Pierre,

i used Mvp4gStarter earlier,
and somehow i suppose that the problem with the RootPanel comes
from the fact that i'm using

<entry-point class="com.mvp4g.client.Mvp4gEntryPoint"/>

now. instead of my own entry point.
As rollback to gwt 2.0 didn't solve my problem :(

Best Regards

Vladislavs Serebro

unread,
Aug 18, 2010, 1:10:00 PM8/18/10
to Mvp4g
DOH.

i should have looked more precisly at the FAQ.

the solution was to use my entry point and call

Mvp4gModule module =
(Mvp4gModule)GWT.create( Mvp4gModule.class );
module.createAndStartModule();

i left out " RootPanel.get().add( (Widget)module.getStartView() );" as
i am not sure which module is refered and how to specify startView
(any hints are be appriciated ;) )

instead as usualy i was able to call RootPanel.get(....) within my
RootPresenter widget.

best regards

Pierre

unread,
Aug 18, 2010, 7:08:38 PM8/18/10
to Mvp4g
The start view is a mandatory parameter of a Mvp4g module. You have to
define it thanks to either (for annotations):
@Events( startView = MainView.class...)

or (for XML):

<start view="rootView" ... />

RootPanel.get().add( (Widget)module.getStartView() );
=> this method will return the start view of the root module (module
with no parent) and add it to the RootPanel.

As a best practice, it's better to do this call in the entry point
than a presenter, because it's better to have no reference to the
widget class inside presenters to be able to test them with Junit
tests.

Pierre

On Aug 18, 1:10 pm, Vladislavs Serebro
Reply all
Reply to author
Forward
0 new messages