PDA

View Full Version : Want to keep the ext gwt application in middle of the browser



urwitharup@yahoo.com
18 May 2009, 9:47 PM
Hello,

I want to keep my web application(with fixed width and variable height) in the middle of the browser. Is there any way to do that?

Regards
Arup

viva
18 May 2009, 11:29 PM
You can use the CenterLayout. just this:

import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.CenterLayout;

public class CenterLayoutExample extends LayoutContainer {

public CenterLayoutExample() {
setLayout(new CenterLayout());

ContentPanel panel = new ContentPanel();
panel.setBodyStyle("padding: 6px");
panel.setFrame(true);
panel.setHeading("CenterLayout");
panel.addText("I should be centered");
panel.setWidth(200);

add(panel);
}
}

urwitharup@yahoo.com
19 May 2009, 10:55 PM
Thanks,

Actually I have an existing base layout which is broderlayout for my application. I can not change it. How to wrap it in center layout?

Regards
Arup

takayser
21 May 2009, 6:19 AM
you may add your existing "base layout" to a container that has a center layout?

urwitharup@yahoo.com
21 May 2009, 4:26 PM
I have tried that. But if Base container is not ViewPort then it does not work.

Base(Parent) Viewport + center layout

Application(Child) LayoutContainer + border Layout


Works

Base(Parent) LayoutContainer + center layout

Application(Child) LayoutContainer + border Layout

does not

We want to make a fix width and dynamic height(scrollable) application. But Viewport will not allow me to have dynamic height application.

Regards
Arup

brendand
25 May 2009, 4:19 AM
Is there a way to have variable width, between to ranges. Eg, between 800 and 1200px wide?