PDA

View Full Version : Headings for ColumnConfig disappears when ContentPanel is placed inside TableData



borledge
18 Feb 2009, 5:50 AM
First, congrats on an awesome library.

I'm having an issue with my ColumnConfig headings disappearing when I try to place the ContentPanel in a TableData element. When I remove it from the Table, they show up fine. I need the TableData so the grids can be nicely formatted.

Thanks in advance,
Brian



ieocMetadataListStore =

new ListStore<ObjectMetadataData>();

opsCenterMetadataListStore = new ListStore<ObjectMetadataData>();
ocmListStore = new ListStore<OpsCenterMappingData>();


TableLayout tl = new TableLayout(4);
tl.setBorder(1);
setLayout(tl);


TableData oneColAlignR = new TableData();
oneColAlignR.setWidth("150px");
oneColAlignR.setHorizontalAlign(HorizontalAlignment.RIGHT);
TableData oneColAlignL = new TableData();
oneColAlignL.setWidth("300px");
oneColAlignL.setHorizontalAlign(HorizontalAlignment.LEFT);
TableData twoColAlignC = new TableData();
twoColAlignC.setWidth("370px");
twoColAlignC.setHorizontalAlign(HorizontalAlignment.CENTER);
twoColAlignC.setColspan(2);
TableData fourColAlignC = new TableData();
fourColAlignC.setWidth("700px");
fourColAlignC.setHorizontalAlign(HorizontalAlignment.CENTER);
fourColAlignC.setColspan(4);
TableData twoColAlignR = new TableData();
twoColAlignR.setWidth("600px");
twoColAlignR.setHorizontalAlign(HorizontalAlignment.RIGHT);
twoColAlignR.setColspan(2);
TableData twoColAlignL = new TableData();
twoColAlignL.setWidth("600px");
twoColAlignL.setHorizontalAlign(HorizontalAlignment.LEFT);
twoColAlignL.setColspan(2);


List<ColumnConfig> ieocListConfigs =


new ArrayList<ColumnConfig>();

ColumnConfig ieocColumnConfig = new ColumnConfig();
ieocColumnConfig.setId("fieldName");
ieocColumnConfig.setHeader("Name");
ieocColumnConfig.setWidth(100);
ieocListConfigs.add(ieocColumnConfig);
ieocColumnConfig = new ColumnConfig();
ieocColumnConfig.setId("fieldType");
ieocColumnConfig.setHeader("Type");
ieocColumnConfig.setWidth(50);
ieocListConfigs.add(ieocColumnConfig);
ieocColumnConfig = new ColumnConfig();
ieocColumnConfig.setId("fieldDescription");
ieocColumnConfig.setHeader("Description");
ieocColumnConfig.setWidth(250);
ieocListConfigs.add(ieocColumnConfig);
ColumnModel ieocColumnModel = new ColumnModel(ieocListConfigs);
ContentPanel ieocCP = new ContentPanel();
ieocCP.setBodyBorder(false);
ieocCP.setHeading("iEOC Fields");
ieocCP.setButtonAlign(HorizontalAlignment.RIGHT);
//ieocCP.setButtonAlign(HorizontalAlignment.LEFT);
Grid<ObjectMetadataData> ieocGrid =


new Grid<ObjectMetadataData>(ieocMetadataListStore, ieocColumnModel);

ieocGrid.setStyleAttribute("borderTop", "none");
ieocGrid.setAutoExpandColumn("fieldDescription");
ieocGrid.setBorders(true);
final GridSelectionModel<ObjectMetadataData> ieocGSM = new GridSelectionModel<ObjectMetadataData>();
ieocGrid.setSelectionModel(ieocGSM);
ieocCP.setLayout(new FitLayout());
ieocCP.setSize(350, 225);
ieocCP.layout();
ieocCP.add(ieocGrid);


List<ColumnConfig> opsCenterListConfigs = new ArrayList<ColumnConfig>();
ColumnConfig opsCenterColumnConfig = new ColumnConfig();
opsCenterColumnConfig.setId("fieldName");
opsCenterColumnConfig.setHeader("Name");
opsCenterColumnConfig.setWidth(100);
opsCenterListConfigs.add(opsCenterColumnConfig);
opsCenterColumnConfig = new ColumnConfig();
opsCenterColumnConfig.setId("fieldType");
opsCenterColumnConfig.setHeader("Type");
opsCenterColumnConfig.setWidth(50);
opsCenterListConfigs.add(opsCenterColumnConfig);
opsCenterColumnConfig = new ColumnConfig();
opsCenterColumnConfig.setId("fieldDescription");
opsCenterColumnConfig.setHeader("Description");
opsCenterColumnConfig.setWidth(350);
opsCenterListConfigs.add(opsCenterColumnConfig);
ColumnModel opsCenterColumnModel = new ColumnModel(opsCenterListConfigs);
ContentPanel opsCenterCP = new ContentPanel();
opsCenterCP.setBodyBorder(false);
opsCenterCP.setHeading("OpsCenter Fields");
//opsCenterCP.setButtonAlign(HorizontalAlignment.RIGHT);
Grid<ObjectMetadataData> opsCenterGrid =


new Grid<ObjectMetadataData>(opsCenterMetadataListStore, opsCenterColumnModel);

opsCenterGrid.setStyleAttribute("borderTop", "none");
opsCenterGrid.setBorders(true);
//opsCenterGrid.setAutoExpandColumn("fieldName");
opsCenterGrid.setAutoExpandColumn(


"fieldDescription");

final GridSelectionModel<ObjectMetadataData> opsCenterGSM = new GridSelectionModel<ObjectMetadataData>();
opsCenterGrid.setSelectionModel(opsCenterGSM);
opsCenterCP.setLayout(new FitLayout());
opsCenterCP.setSize(350, 225);
opsCenterCP.layout();
opsCenterCP.add(opsCenterGrid);



//these DON'T show column headings
//add(ieocCP, twoColAlignC);
//add(opsCenterCP, twoColAlignC);


//these DO show column headings
add(ieocCP);
add(opsCenterCP);