PDA

View Full Version : Bottom toolbar in a contentpanel doesn't appear



nel2703
20 Feb 2009, 8:44 AM
Hi all,

I've tried to make a simple content panel which contains a grid (at the top), a textarea bellow and a bottom toolbar ... that is all..
I've make some tries with ContentPanel.setComponent and I haven't achieved what I wanted, the bottom toolbar just take place if I push up the panel resizing it manually.
This content panel will be a child for a panel in gwt-ext.

I've attached the screen showing what I've just said.

And this is how I've coded:


class Comment extends ContentPanel {
...
private void configureLayouts() {
BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH);
northData.setSplit(true);
northData.setMinSize(80);
add(grid, northData);

ContentPanel bottomPanel = new ContentPanel();
bottomPanel.setLayout(new FitLayout());
bottomPanel.setBorders(false);
bottomPanel.setHeaderVisible(false);
bottomPanel.setHeight("100%");
comment = new TextArea();
comment.setWidth("100%");
comment.setEmptyText(localizedText.enterNewComment());
comment.setReadOnly(true);
comment.addListener(Events.OnClick, new Listener<FieldEvent>(){

public void handleEvent(FieldEvent field) {
if (!comment.isReadOnly()) {
buttonNew.setEnabled(false);
buttonSave.setEnabled(true);
}
}

});

bottomPanel.add(comment);
bottomPanel.setBottomComponent(createBottomToolbar());
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setSize(1);
centerData.setMargins(new Margins(0));
add(bottomPanel, centerData);
}
...
}I would appreciate any help...