What is the best way to lay out elements in GWT?
Posted
by
KutaBeach
on Stack Overflow
See other posts from Stack Overflow
or by KutaBeach
Published on 2012-06-28T20:11:23Z
Indexed on
2012/06/28
21:16 UTC
Read the original article
Hit count: 189
What is the best practice to specify the positions of elements in GWT widget?
Imagine you have a task: place a set of widgets in page layout. What would you use to position all your buttons and inputs in some order?
- standart HTML markup with tables/divs + CSS styles for positioning
- GWT widgets: panels, grids, tables + CSS styles for positioning
- GWT widgets: panels, grids, tables + their native properties for positioning
If 2 or 3 - what would you use to reproduce a standart HTML table with colspans, fixed width columns and paddings?
ps UIBinder and XML markup. GWT 2.4
My opinion: one of the biggest advantages of GWT is the ability to prevent programmer from writing HTML markup and add cross-browser support for interfaces. We shouldn't drop these points so its better to choose p.3 and try to use CSS ONLY for decoration - i.e. colors, fonts etc.
Another point of view: its a bad idea to place any styles inline. By specifying properties of the widgets in XML markup we are literally doing exactly this. Also, GWT doesn't have enough widgets to produce a normal layout. For example you need to create a simple table with collspans and fixed column width. How would you go about this? Looks like you have to embed several HorizontalPanels into VerticalPanels, specify width/height in everyone of them and produce a great paper of XML by this.
So whats your opinion?
© Stack Overflow or respective owner