PDA

View Full Version : Center aligning form items inside a tab



Chandler
12 May 2010, 12:58 AM
Hi there,

I am getting my hands dirty now with Gxt and I have a following setup for one of my UI's.

FormPanel which contains 2 tabs.
In tab 1, I have general form elements with Formlayout.
In tab 2, I have basic DualListField.

I wanted to know how can one center align the form items in tab 1 without using margin-left: n% (n = some number)
I want to stay away from specifying fixed values for the layout for purposes of different screen resolution.
So is there a way one can center align those form elements to appear in center instead of being left aligned by default.

Thanks

jocy
12 May 2010, 3:19 AM
try to use CenterLayout.

Chandler
12 May 2010, 4:18 AM
Hi,

tx for the reply. I tried using CenterLayout in the FormPanel but that messes up everything for me mainly in the form of width and height and I want to avoid specifying manual height and width. I tried with setAutoXYZ - true, even that didn't resolve it for me

jocy
12 May 2010, 5:50 AM
create a layoutcontainer set is layout centerlayout and put it in your formpanel or try setAutoHeigth/setAutoWidht...