PDA

View Full Version : Borderlayout (Ext GWT) & GWT



stockhausen
12 Feb 2010, 5:49 AM
Hello,

I need help to create a simple Borderlayout.

My result looks like this:

http://img5.imageshack.us/img5/7331/borderlayout.jpg


Here you can find the ExtJS example: http://www.extjs.com/examples/#borderlayout (http://www.extjs.com/forum/../examples/#borderlayout)


My source code:


public void onModuleLoad() {

BorderLayout borderLayout = new BorderLayout(); // unused!

ContentPanel north = new ContentPanel();
ContentPanel west = new ContentPanel();
ContentPanel center = new ContentPanel();

north.add(new Label("North"));
west.add(new Label("West"));
center.add(new Label("Center"));

final BorderLayoutData northLayout = new BorderLayoutData(LayoutRegion.NORTH, 300);
final BorderLayoutData southLayout = new BorderLayoutData(LayoutRegion.SOUTH, 100);
final BorderLayoutData centerLayout = new BorderLayoutData(LayoutRegion.CENTER, 100);

ContentPanel mainPanel = new ContentPanel();
mainPanel.add(north, northLayout);
mainPanel.add(west, southLayout);
mainPanel.add(center, centerLayout);

// mainPanel.setLayout(borderLayout);

RootPanel.get().add(mainPanel);
}
Whats wrong with my code?

Best rigards,
Michael

bsmithny
12 Feb 2010, 9:59 AM
What is wrong depends on how you want it to look(you dont say)...
One thing I notice is that you are using southlayout on something called west - is that what you meant to do?