Closed GoogleCodeExporter closed 9 years ago
Could this message help you
http://groups.google.com/group/mvp4g/browse_thread/thread/8ced7f667001afe4?
I will look at it and let you know.
Original comment by plcoir...@gmail.com
on 27 Jan 2010 at 12:11
The problem is by default Mvp4g add the RootView to GWT RootPanel. LayoutPanel
(like
DockLayoutPanel) doesn't work well with RootPanel.
A workaround for this issue is to not use the default entry point of Mvp4g but
uses
your own and have the following lines of codes:
Mvp4gModule module = (Mvp4gModule)GWT.create( Mvp4gModule.class );
module.createAndStartModule();
RootLayoutPanel.get().add((Widget) module.getStartView());
Original comment by plcoir...@gmail.com
on 27 Jan 2010 at 12:46
I had actually tried the second part of that message :
Mvp4gModule module = (Mvp4gModule)GWT.create
( Mvp4gModule.class );
module.createAndStartModule();
RootPanel.get().add((Widget) module.getStartView());
with no luck (after, of course, changing the .xml etc. to load from a module.
I just tried adding the constructor mentioned in the first. It failed to create
the
Element, but by just using the .add it seems to work. Of course, I'm not sure
that
what it's generating is perfect, but at least the data is being displayed!
public RootTemplateView(){
RootLayoutPanel.get().add(dock);
/*Element element=DOM.createDiv();
element.setClassName("hidden");
setElement(element);*/
}
Original comment by hipgno...@gmail.com
on 27 Jan 2010 at 12:46
With your demo I tried your method and it worked. However, with my actual
project I've
found I need the RootLayoutPanel.get().add(dock) line.
I'm not sure what's different, apart from the fact that I have an
DockLayoutPanel
embedded in the main DockLayoutPanel (a similar configuration to the GWT E-Mail
sample).
Original comment by hipgno...@gmail.com
on 27 Jan 2010 at 1:47
Your RootView extends LazyPanel, right? Could this be the problem?
A DeckPanel can only have a LayoutPanel as a parent, but in the case your view
extends a LazyPanel, then the parent of the DeckPanel is a SimplePanel, that
could
explain why the DeckPanel is not displayed.
Could you try to have your view extends Composite instead of LazyPanel?
Original comment by plcoir...@gmail.com
on 27 Jan 2010 at 3:49
I only know Mvp4g at the usage level but I don't think it is a bug with Mvp4g
itself. I am using Mvp4g 1.1
In addition to using RootLayoutPanel (and <!DOCTYPE>) as pointed out by
plcoirier (Jan 2, 2010), it seems that the start view and its chain have to be
layouts ... below is what I got ...
MainView.ui.xml ...
<g:DockLayoutPanel unit="PX">
<g:north size="25">
<g:HorizontalPanel>
<g:cell width="1200" horizontalAlignment="ALIGN_RIGHT">
<g:MenuBar ui:field="menu" width="140px" animationEnabled="true" autoOpen="true">
<g:MenuItem ui:field="settingMenuItem">
<g:MenuBar vertical="true" animationEnabled="true">
<g:MenuItem ui:field="preferenceMenuItem"/>
</g:MenuBar>
</g:MenuItem>
<g:MenuItem ui:field="loginMenuItem"/>
</g:MenuBar>
</g:cell>
</g:HorizontalPanel>
</g:north>
<g:north size="30">
<g:DecoratedTabBar ui:field="tabBar"/>
</g:north>
<g:center>
<g:LayoutPanel ui:field="body"/>
</g:center>
</g:DockLayoutPanel>
ContentListView.ui.xml ... content of "body" above ...
<g:DockLayoutPanel unit="PX">
<g:north size="30">
<g:SimplePanel>
<g:Label>Header</g:Label>
</g:SimplePanel>
</g:north>
<g:south size="30">
<g:SimplePanel>
<g:Label>Footer</g:Label>
</g:SimplePanel>
</g:south>
<g:center>
<g:SimplePanel>
<g:Label>Body</g:Label>
</g:SimplePanel>
</g:center>
</g:DockLayoutPanel>
Original comment by ltb...@gmail.com
on 21 Jul 2010 at 4:23
I'm closing this bug since Mvp4g can be used with any kind of layout.
Original comment by plcoir...@gmail.com
on 11 Nov 2010 at 11:52
Original issue reported on code.google.com by
hipgno...@gmail.com
on 26 Jan 2010 at 5:13Attachments: