views:

544

answers:

1

How to place a control at the center of a canvas?

I have a main VLayout set to 100%width and 100% haight. I want to place a grid at the center of this layout, meaning at the center of the browser' viewport. How to do that with smartGWT layouts?

setLayoutAlign(Alignment.CENTER)

This places the controls center to the layout's breadth axis. But if I nest HLayout and VLayout it is not giving desired result.

+1  A: 

you have to set the layoutAlign on all nested Layout panels.
the configuration is not inherited from parent panels and while HLayout defaults to TOP, VLayout defaults to LEFT.

dube