Recommendations for creating a GUI in GWT

I recently started learning the Google Web Toolkit. I went through some walkthroughs and I think I understand the basics and the idea. However, I have some questions about the overall architecture and design of the applications.

Let's start with the graphical interface. I want to create a “general” web application where the user first sees the login page. After a successful login, the user is redirected to some kind of index page and a menu is added. I created a new LoginComposite for the login page and tried to create a beautiful HTML table using the GWT Designer. However, it seems to me that this is really difficult to do, since you cannot set any individual properties in separate cells (TD)? It is not possible to specify colspan or rowspan, and I cannot set any extras or fields on the cells themselves. In short, I know for sure how I would write HTML code, but I can't translate this into a constructor. Is it just me?

Also, I am wondering about best practices for building and designing code. I went through the StockWatcher tutorial, but it really is not a very realistic web application. For example, I would like to know how I should create different forms (each of them should be in own class inheriting Composite-class)? How can I switch between forms (for example, first a list view, then a form for editing a selected item from a list, and then a completely different page)? If I have one Composite for each page and create them when necessary in my EntryPoint, does this mean that the client will load all the JavaScript for all these composites when the page loads? Should I stick to just one HTML page, or do I need a lot?

These are questions that are not covered by any GWT tutorial. If anyone knows a good example of a “real” web application built using GWT, I'd love to see it.

Thanks for your input!

+6
source share

Source: https://habr.com/ru/post/892443/


All Articles