DockLayoutPanel inside UiBinder requires height="100%"

611 views
Skip to first unread message

Jeff Schnitzer

unread,
Nov 4, 2010, 10:29:01 PM11/4/10
to google-we...@googlegroups.com
This may save someone the ~4 hours it cost me:

Can't figure out why your DockLayoutPanel doesn't render when you
place it anywhere except *directly* inside a RootLayoutPanel? It
needs height="100%":

<g:FlowPanel>
<g:DockLayoutPanel unit="PX" height="100%">
...
</g:DockLayoutPanel>
</g:FlowPanel>

Without this height, DockLayoutPanels inside any other widget
(including nested DockLayoutPanels) collapse to 0.

Today sucked.

Jeff

Rud

unread,
Nov 4, 2010, 11:04:56 PM11/4/10
to Google Web Toolkit
More specifically it needs to be inside a layout panel of some type,
or reference as a RootLayoutPanel. Any of the layout panels have this
requirement.

Rud
http://www.MysticLakeSoftware.com

Jeff Schnitzer

unread,
Nov 5, 2010, 2:27:09 PM11/5/10
to google-we...@googlegroups.com
This requirement should *really* be mentioned in the javadocs for
DockLayoutPanel. Searching this list, a lot of people seem to be
stumbling on this issue.

Jeff

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

zixzigma

unread,
Nov 16, 2010, 2:22:59 AM11/16/10
to Google Web Toolkit
I wasted hours on this, tried everything but still couldnt get it to
work.
I had a feeling it had to do something with size, but didnt know this
about height="100%"

I had a top level application level DockLayoutPanel (outer). it worked
fine without height="100%"

However, when I wanted to programmatically insert another
DockLayoutPanel (inner) in the <g:center> of the application level
DockLayoutPanel,
only the north section of the inner DockLayoutPanel would show up.

the other thing i found out was a problem with <g:Scrollbar> , when
wrapped around outer , though i am not sure on this.
<g:scrollbar>
<g:center>
<g:SimplePanel ui:field="name"/>
<g:center>
<g:scrollbar>

it was definitely a very very nasty hidden quirk.

Do not Forget to set Height to 100%

Thank you for sharing.

zixzigma

unread,
Nov 16, 2010, 2:28:04 AM11/16/10
to Google Web Toolkit
<g:ScrollPanel> : )

suersh babu

unread,
Nov 16, 2010, 4:05:39 AM11/16/10
to google-we...@googlegroups.com
Even I faced the same problem in UI binder only shows  the north side when I put it in RootPanel I also wasted little time over it,  Thanks for  information provided.


Regards
Suresh Babu G

On Tue, Nov 16, 2010 at 12:58 PM, zixzigma <zixz...@gmail.com> wrote:
<g:ScrollPanel> : )


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




--
Regards

Suresh Babu G

Ryan Rathsam

unread,
Dec 22, 2010, 2:34:07 PM12/22/10
to Google Web Toolkit
Hi Jeff,

Thank you thank you thank you. I've been searching on and off for the
past 2-3 days for this information. Couldn't figure out why the
DockLayoutPanel refused to show up, tried futzing with the CSS to no
avail. You have helped restore a bit of sanity to this whole process.

Thanks again,

Ryan

On Nov 4, 9:29 pm, Jeff Schnitzer <j...@infohazard.org> wrote:
> This may save someone the ~4 hours it cost me:
>
> Can't figure out why yourDockLayoutPaneldoesn't render when you
> place it anywhere except *directly* inside a RootLayoutPanel?  It
> needs height="100%":
>
> <g:FlowPanel>
>         <g:DockLayoutPanelunit="PX" height="100%">

Thomas Broyer

unread,
Dec 22, 2010, 3:37:26 PM12/22/10
to google-we...@googlegroups.com
See http://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html#Recipes "Using a LayoutPanel without RootLayoutPanel"
See also http://code.google.com/intl/fr-FR/webtoolkit/doc/latest/DevGuideUiPanels.html#Resize which says "The purpose of these two interfaces is to form an unbroken hierarchy between all widgets that implement RequiresResize and the RootLayoutPanel, which listens for any changes (such as the browser window resizing) that could affect the size of widgets in the hierarchy."
(note that there's a link from the RootLayoutPanel description in the same doc: "This panel is a singleton that serves as a root container to which all other layout panels should be attached (see RequiresResize and ProvidesResize below for details)")
So it really is documented.
Reply all
Reply to author
Forward
0 new messages