PDA

View Full Version : Using a LayoutContainer Widget in ColumnConfig



stemkev
5 Nov 2009, 7:17 AM
Hi all,

I'm using a combo box in the Grid column header by calling ColumnConfig.setWidget(myComboBox);

Its working fine, but now I need to add a label well. I've tried creating a LayoutContainer to hold my combo box and the label and then setting that as the widget on the ColumnConfig, but the column header now renders blank.

Any thoughts on what I'm doing wrong. My code looks like this:




ColumnConfig columnConfig = new ColumnConfig("someId", "someName", 100);
LayoutContainer container = new LayoutContainer();
VBoxLayout layout = new VBoxLayout();

layout.setPadding(new Padding(5));
layout.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);

container.setLayout(layout);
container.add(this.myComboBox, new VBoxLayoutData(new Margins(5)));
container.add(new Label("Hello"), new VBoxLayoutData(new Margins(5)));

//FIXME We should be providing the layout container here instead of the
//combo box but it doesn't render.
columnConfig.setWidget(this.accountsComboBox, this.i18n.accountColumnHeader());

stemkev
9 Nov 2009, 9:33 AM
I switched from using a LayoutContainer with a VBoxLayout to a VerticalPanel.

It works now, but I noticed the dropdown part of the combo box is not aligned correctly when viewed in the Hosted Mode browser. Looks fine in Firefox though. Haven't tried IE yet.