Scroll are not coming while using DockLayoutPanel

477 views
Skip to first unread message

saurabh saurabh

unread,
Dec 5, 2011, 9:54:30 AM12/5/11
to Google Web Toolkit
Hi everyone,
I got the following lines of code here:


DockLayoutPanel doc = new DockLayoutPanel(Unit.PX);
....
//some code goes here to add widgets to doc
....

RootLayoutPanel.get().add(doc);

Now the size of docklayoutpanel here exeeds client window height but I
am not getting any scroll bars here on browser. I see css property
'overflow: hidden' could be a problem but taking out all 'overflow:
hidden' makes it more ugly.
I hope there would be a better solution to handle this problem

Thanks in advance

Alexandre Ardhuin

unread,
Dec 5, 2011, 10:18:17 AM12/5/11
to google-we...@googlegroups.com
Hi,

You have to explicitly add ScrollPanel in your DockLayoutPanel to make the area scrollable.

Alexandre

2011/12/5 saurabh saurabh <saurab...@gmail.com>

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


Zakaluka

unread,
Dec 12, 2011, 10:57:53 PM12/12/11
to Google Web Toolkit
I don't mean to hijack this thread, but I have been looking for the
same thing.

ScrollPanels in a DockLayoutPanel may be okay, but this behavior is
different from general web mechanics and what most people expect - web
pages as a whole scroll, not just small sections (usually, anyway).
There doesn't seem to be any way to get the DockLayoutPanel to expand
past the page's edge to make all the content of the center area
visible.

Adding the DockLayoutPanel to a ScrollPanel doesn't work (even if you
take out the "position:relative" style from the ScrollPanel <div>)
because the DockLayoutPanel's center doesn't expand to allow all its
content to fit. Does anyone know if there is a solution for this.

Regards,

Z.

On Dec 5, 7:18 am, Alexandre Ardhuin <alexandre.ardh...@gmail.com>
wrote:


> Hi,
>
> You have to explicitly add ScrollPanel in your DockLayoutPanel to make the
> area scrollable.
>
> Alexandre
>

> 2011/12/5 saurabh saurabh <saurabh.bl...@gmail.com>

Steffen Schäfer

unread,
Dec 13, 2011, 4:27:23 AM12/13/11
to google-we...@googlegroups.com
The *LayoutPanels are intended for web applications that use the full page (viewport of the browser) as a rich client would do it. It's not for "website" like layouts.

I think this is related to your problem:
http://stackoverflow.com/questions/6740617/gwt-layoutpanel-size

Ed

unread,
Dec 13, 2011, 9:23:26 AM12/13/11
to Google Web Toolkit
Maybe off topic but I normally play around with CSS "overflow: auto"
and min/max height on the correct div to get scrollbars there were I
want them. You can do this with any panel you want (I never use
Scroll/Dock/etc... panels for this).
- Ed


On Dec 13, 10:27 am, Steffen Schäfer <steffen.scha...@googlemail.com>
wrote:

Reply all
Reply to author
Forward
0 new messages