Question

I'm brand new to GWT and am using the GWT Designer to help acclimate me to it. So far I've been able to get a few simple examples up and running locally, but after trying to figure out how to do a few things myself, and not being able to find answers to them in the GWT docs, I have a few questions regarding the Designer and its usage:

  1. How do I create an HTML table, or a TableLayout? Although the docs show the existence of a TableLayout, I don't see it available in the Designer palette (even under the Cell Widgets section). Basically, I want the ability to organize my widgets in a tabular fashion and can't figure out how to do it.
  2. When (taking into account "GWT Best Practices" and other procedures that the GWT team endorses/encourages) should one use SafeHTML, and why? How does the Designer promote this? I don't see any "Safe HTML" widgets in the Designer palette.
  3. In order to create an interesting UI of any nature, I find myself nesting panels, inside of panels, inside of yet more panels (like you would in Swing). Is this the normal way of doing things in GWT, or am I making things more complicated than I need to?
  4. I'm beginning to understand how to use the GWT Designer to design individual panels, or "portions" of a page, but how/where do you actually design the layout/configuration of the entire page? For instance, 1 page might have 5 different major HorizontalPanels, each of which contain an intricate nesting of other panels and widgets. How do you layout each of the major panels so as to produce a full-fledged page?

Thanks in advance for any help here!

Was it helpful?

Solution

  1. The Cell library was meant to extended from the ground up, so yes, you need to write this functionality yourself.
  2. The GWT Designer is meant to be a tool for GWT newcomers, and lacks some of the more sopisticated features (such a the Safe* API). As @Jason Tholtstrup noted, this framework is for helping to prevent against XSS and XSRF attacks.
  3. Yes, just like Swing: panels inside of panels inside of panels. It's like Inception.
  4. You organize your page into different display regions, which you lay out via CSS rules (see CssResource and ClientBundle). Each display region is actually an AcceptsOneWidget implementation, which you pass to whatever mechanism (usually a Presenter or an Activity implementation) you are using to control the view-portion of the app.

OTHER TIPS

2) Safe html will help protect you from Cross-site-scripting attacks. Basically it escapes data (which may have come from a user) so that malicious html can't be injected from your application variables.

3) Yes, pretty much how it works.

hope that helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top