Monday, December 21, 2015

Understanding the Layout System

I've been reading a lot about the LayoutPanels introduced in 2.0 and trying to understand their purpose. I keep seeing that I should be using these instead of the older panels, but they seem way more complicated and limiting.

Take my app, for example. It's got a straight forward interface: A fixed header, fixed menu on the left, and a fixed footer. The remaining space is the content of unknown size.

For this, I use a DockLayoutPanel, and it works well. What does not work well is the content part. It makes complete sense to use a ScrollPanel here (right?), to accommodate any amount of content. And of course, that breaks the ProvidesResize/RequiresResize chain (although the ScrollPanel does indeed implement both of those methods...).

So anyway. I want to use the TabLayoutPanel in place of the TabPanel I am currently using, as that's the recommendation, but I can't. It won't show because it's not getting sized. So what can I do? Give it a static size or put it in a ResizeLayoutPanel to handle the resizing, which isn't much better as I still have to specify the size. I don't know how big the content of the tab panel will be, so that's just not an option.

From what I read, these panels do not work with dynamic sized content.

So what's the deal here? I can see the RootLayoutPanel and DockLayoutPanel being used to set up the basic layout of the app. But what of the rest of these panels like the TabLayoutPanel and StackLayoutPanel? Unless I'm using these as the ground work for an entire app, they seem useless. I'd like to use them as they build their underlying DOM elements with divs instead of a bunch of nested tables, but I guess that's not an option? 

Am I missing something? Am I still suppose to be using the old panels for everything but the base layout of the app? Or is there some sort of new way of building web apps that doesn't require dynamically sized content that I haven't heard about?

I feel like a bunch of this old stuff will be deprecated soon in favor of the LayoutPanels, but where does that leave me when it doesn't work for what I need?

Thanks for any advice.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment