Adjusting height of GWT Panels based on content dynamically

1,108 views
Skip to first unread message

Santosh

unread,
Aug 8, 2012, 3:27:28 AM8/8/12
to Google Web Toolkit
We have many screens where different types of GWT panels are used. One
common problem across many screens is that, content size is derived at
runtime. So, if I define a height for a panel(Vertical/Horizontal/
DockPanel) and when any new components are getting added within panel
or content is more, panel height remains the same. So we are not able
to see the contents. UI look and feel becomes worst. How do we handle
the height problems? Do we have to manually code to adjust every panel/
widget height when something gets changed in screen. Is it not a very
bad way of coding?
Also, now we have datagrids at some places, if no of records are very
less, we see a huge space left out below datagrid, not sure how do we
handle these cases?

Somebody please suggest as it is quite urgent.

Alexandre Ardhuin

unread,
Aug 8, 2012, 4:08:07 AM8/8/12
to google-we...@googlegroups.com
Hi,

Have you look at com.google.gwt.user.client.ui.HeaderPanel ?

Alexandre


2012/8/8 Santosh <santos...@darkhorseboa.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.


Andrei

unread,
Aug 8, 2012, 4:46:42 PM8/8/12
to google-we...@googlegroups.com
You use the same HTML/CSS techniques for building fluid layouts in GWT as in any other framework. You want to rely as much as possible on the browser's ability to re-flow the content, instead of using fixed width/heights. Typically this means using a LayoutPanel to split the page into 2-3 areas (e.g. Top Menu, Left Menu, and Main Area), and using pure HTML (HTML panel) or FlowPanels to organize the content inside those areas.

Normally you would also wrap the main area in a ScrollPanel for situations when content does not fit into the visible area of the browser window.

Personally, I almost never use Vertical or Horizontal panels, because you can easily achieve the same layouts with CSS while keeping them more flexible.

I suggest that you do some additional reading on "using CSS for fluid page layouts": you can use all of suggested techniques in GWT.

Santosh

unread,
Aug 10, 2012, 8:30:24 AM8/10/12
to Google Web Toolkit
Thanks for your valuable inputs. As you have suggested, I will do some
reading on using css for fluid page design. Hope I will be more clear
afterwards. I will get back to you if any more clarifications needed.

Header Panel will help me to create a header, content and footer
area. Anything more about that related to my issue?
Reply all
Reply to author
Forward
0 new messages