I am using a similar strategy and it works just fine. I suspect it may be a problem with your DockLayoutPanel sizing. Please check if the sizes are 100%, also give the panel a border for debugging to see how your layout looks...

If it helps, I have listed my UiBinder file.

<ui:style>
        .layout {
            border-width:1px;
            border-style:solid;
            width: 100%;
            height: 100%;

        }

        .mainlayout {
            width: 100%;
            height: 100%;
            position:relative;
            top:2em;
            left: 2em;
        }
</ui:style>
<g:DockLayoutPanel styleName='{style.mainlayout}' unit='EM'>
<g:north size='2' unit="EM">
<g:FlowPanel ui:field="header"/>
</g:north>
<g:center>
<g:ScrollPanel styleName='{style.layout}'>
<g:FlowPanel ui:field="content"/>
</g:ScrollPanel>
</g:center>
<g:south size="1" unit="EM">
<g:FlowPanel ui:field="footer"/>
</g:south>
</g:DockLayoutPanel>
</ui:UiBinder>

-- Prashant

On 19-02-2010 09:50, digitalsam007 wrote:
Hello,

I have been trying to implement the MVP pattern in my new GWT app. I
have followed the Contacts example app and it seems to be quite
straightforward. In there, the controller passes the root
panel(container) to every presenter in its go method. And these
presenters add the respective view(Display) to the container.

However, in my case I have to use a template with Header, footer,
Navigation and Content. Something quite similar to the Mail sample app
found in the GWT SDK. I tried to create a wrapper view class and its
corresponding Presenter and included all the 4 diffrent views viz
header, footer, nav and content in it ( WrapperView.ui.xml).

I provided extra methods in the WrapperView that can return HasWidgets
for each of the segments in the page like this -

HasWidgets getHeaderContainer()
HasWidgets getContentContainer()
HasWidgets getFooterContainer()
HasWidgets getNavContainer()

In the WrapperView.ui.xml , i added a dockLayoutPanel which inturn
contains each of these containers ( each container elemensta re in
turn SimplePanel components which contains the actual widgets for
Header, footer...etc)

<g:DockLayoutPanel unit='EM'>
                <g:north size='5'>
                        <miab:HeaderContainerView ui:field='headerContainer' />
                </g:north>
                <g:center>
                        <miab:ContentContainerView ui:field='contentContainer' 
/>
                </g:center>
                <g:south size="2">
                        <miab:FooterContainerView ui:field='footerContainer' />
                </g:south>
</g:DockLayoutPanel>

So, the first time when the module loads and the AppController.go
method is invoked I trigget the history with a new tocket eg Home.
This invokes the valueChanged method and in that I create the
WrapperView (if not already created; yes i maintain a reference to
this object in AppController) and present it on screen. Then, I call
the views getContentContainer method and try to add the content
directly to that in another presenter. I do not pass the topmost
container this time.

Logically it should work and the content area must be refreshed with
the respective Views when diffrent presenter presents it. But
unfortunately I cannot achieve what I want to yet. So, could anyone of
you provide me with some ideas or may share with me the best way of
achieving this usecase?

Any help in this regard will be highly appreciated

Regards

Sam


--
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-tool...@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