Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT RootPanel vs RootLayoutPanel

Tags:

gwt

I understand that officially GWT recommends using the newer RootLayoutPanel but some posts on the internet claims that for some web applications it is better to use the RootPanel.
How can one decide which one to use?
Is there any different use cases for each? (or every requirement can be satisfied with either)

like image 833
kroiz Avatar asked Apr 15 '12 07:04

kroiz


1 Answers

RootLayoutPanel can't be better. It is just different.

RootPanel allows you to add widgets to the page (basically you can use some html element on the page as root widget). You can define multiple RootPanel's in the same application.

RootLayoutPanel behaves a little bit differently, it always tries to fill all the available size in the window, so the content inside of the panel will perfectly fit the browser window size. It will also track the size of the window, and will resize child elements accordingly (if they support it). Also RootLayoutPanel will try to attach itself directly to the <body> element, e.g. you can't choose which html element on the page will become a "starting point".

So, depending on what you want to do you can choose RootPanel or RootLayoutPanel.

like image 129
jusio Avatar answered Oct 04 '22 11:10

jusio