Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8146973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:11:24+00:00 2026-06-06T14:11:24+00:00

What is the best practice to specify the positions of elements in GWT widget?

  • 0

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?

  1. standart HTML markup with tables/divs + CSS styles for positioning
  2. GWT widgets: panels, grids, tables + CSS styles for positioning
  3. 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:11:25+00:00Added an answer on June 6, 2026 at 2:11 pm

    GWT generates terrible, horrible, no-good, very-bad HTML. This is just my opinion, and others will disagree. But I work with GWT every day, and the infinitely nested divs and tables are enough to make even a newbie web developer cry. And all of its styles are inline, so if you want to apply or override these with an external style sheet, you’ll end up with a forest of !important declarations.

    It does, however, generate amazingly lovely JavaScript. As someone who once had to maintain and develop a supremely complex DHTML project and provide support for IE 5.5 and up — by hand — I have to admit, this is the best part of GWT.

    Admittedly, I am a DHTML purist, having been a web devleoper long before I became a software developer. Personally I believe that HTML should only be for structure, CSS should provide styling, and JavaScript should provide the other functionality, and all three should be completely separate. GWT is pretty good at the last part — the JavaScript — but its generated HTML offends my sensibilities and is at least ten times more complicated than it has to be. But then again, most generated code is. (Consider websites created in MS Word or the HTML generated from WYSIWYG-style editors.)

    Given a complex web-based application — and the restriction against rolling a Ruby on Rails application — I’d happily go with GWT. But my app would be pretty much a collection of FlowPanels (which compile to HTML <div>s) and GWT-generated Javascript, with my own CSS on top. So in the situation laid out by the OP, I’d use a FlowPanel, add the elements (eg. GWT form elements), apply any server-side logic, and then do styling with external CSS.

    When looking at GWT, you may want to consider whether you’ll be wanted to re-design your application later on, or wish to have a designer or other non-programmer create templates/styles/CSS to apply on top. If this is the came, you’ll want to be very careful when you design your GWT app to not apply styles and instead apply classes and id’s.

    Also as a testing side note: if you plan on using Selenium for UI testing, you’ll really want to hang id’s on things. The xpath’s from the generated HTML are practically unsuable and can stretch into the hundreds of characters in length.

    This being said, I’d be very interested in hearing about other peoples’ experiences, especially if they differ from mine.

    tl;dr version:

    1. GWT-generated HTML is quite bad with nested tables and many layers of nested <div>s (more than necessary)
    2. GWT does not generate CSS stylesheets, but places all styling inline. This makes using external stylesheets tedious and difficult.
    3. GWT does an excellent job with cross-browser Javascript.
    4. GWT does not, by default, attach id’s to elements, so if you plan on using a tool like Selenium, you must add your own id’s by hand or face amazingly long xpath’s like you’ve never seen before.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the best/correct practice to specify version within your source code tree? What
I've learned that it is a best practice to explicitly specify image dimensions. The
Is there a pattern or best practice in Rails whereby we can specify, in
Where is the best place to specify required repositories for maven projects, pom.xml or
Best practice is to use unique ivs, but what is unique? Is it unique
Short best practice question: If an object A is injected into another object B,
The 'best practice' (as I see it) to atomically create a new file, is
The best practice seems to be to use assert for a condition that should
What would be the best practice to keep the user logged in if he
Is there a best practice for making an entity immutable? Users create exercises in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.