tags:

views:

119

answers:

2

This sounds like a pretty simple thing to do but I havent been able to find an easy way to do this. How do I create a panel with a title and a border which can contain my widgets? I have seen the SectionStack class which provides this. But I dont want to create a section stack.

Window can be added to a layout and drawn. But is it the only way or is there a container class that I am missing?

Also, how does one center things? Say a textfield and a button at the center of the page. How is this achieved?

A: 

To do form-related tasks, look into DynamicForm. To set the inputs in the form, you use setItems(Item...). A text field is a TextItem. You set it's title to control the label that SmartGWT will build. To get a title for the form, the best I've come up with is to use a container canvas that will contain both the title (probably a Label element) and the DynamicForm. To center the inputs, I believe you'd need to use setAlignment on the DynamicForm.

Hank Gay
Thanks for the response. I ended up doing what you have suggested but not quite satisfied with the outcome. This is a very basic task and if you see the other available frameworks, they make this very easy. Shouldn't be so hard or time consuming in a framework that is great otherwise!
atlantis
A: 

You could create an object that is actually a VLayout that contains a Label (the tile), has a border as you need and includes a Canvas (the generic stuff you want included).

In my experience, I noticed that very often I have a DynamicForm visible, so I just add a BlurbItem control to diplay the tile and a small explanation.

Lenz
Thanks. See my comment to Hank Gay's response above.
atlantis