Friday, April 27, 2012

FlexTable.getColumnFormatter().setWidth has no effect

I have set the column width as follow but the output does not follow the .getColumnFormatter().setWidth as attached image, for example, column 3 should be 5% but from the attached image, column 3 (the textbox next to the listbox) is must larger than 5%, why will these happen?

FlexTable ehr_noTable = new FlexTable();
ehr_noTable.setWidget(0, 0, lblEhr_No);
//miscTable.getFlexCellFormatter().setColSpan(0, 0, 3);
ehr_noTable.setWidget(0, 1, lbEhr_No);
ehr_noTable.setWidget(0, 2, txtEhr_No);
FlexTable miscTable = new FlexTable();
miscTable.setWidth("100%");
miscTable.getColumnFormatter().setWidth(0, "14%");
miscTable.getColumnFormatter().setWidth(1, "6%");
miscTable.getColumnFormatter().setWidth(2, "5%");
miscTable.getColumnFormatter().setWidth(3, "14%");
miscTable.getColumnFormatter().setWidth(4, "6%");
miscTable.getColumnFormatter().setWidth(5, "5%");
miscTable.getColumnFormatter().setWidth(6, "14%");
miscTable.getColumnFormatter().setWidth(7, "6%");
miscTable.getColumnFormatter().setWidth(8, "5%");
miscTable.getColumnFormatter().setWidth(9, "14%");
miscTable.getColumnFormatter().setWidth(10, "6%");
miscTable.getColumnFormatter().setWidth(11, "5%");
miscTable.setWidget(1, 0, lblText1);
miscTable.setWidget(1, 1, lbText1);
miscTable.setWidget(1, 2, txtText1);
miscTable.setWidget(1, 3, lblText2);
miscTable.setWidget(1, 4, lbText2);
miscTable.setWidget(1, 5, txtText2);
miscTable.setWidget(1, 6, lblText3);
miscTable.setWidget(1, 7, lbText3);
miscTable.setWidget(1, 8, txtText3);
miscTable.setWidget(1, 9, lblText4);
miscTable.setWidget(1, 10, lbText4);
miscTable.setWidget(1, 11, txtText4);
//       
miscTable.setWidget(2, 0, lblText5);
miscTable.setWidget(2, 1, lbText5);
miscTable.setWidget(2, 2, txtText5);
miscTable.setWidget(2, 3, lblText6);
miscTable.setWidget(2, 4, lbText6);
miscTable.setWidget(2, 5, txtText6);
miscTable.setWidget(2, 6, lblText7);
miscTable.setWidget(2, 7, lbText7);
miscTable.setWidget(2, 8, txtText7);
miscTable.setWidget(2, 9, lblText8);
miscTable.setWidget(2, 10, lbText8);
miscTable.setWidget(2, 11, txtText8);
//
miscTable.setWidget(3, 0, lblText9);
miscTable.setWidget(3, 1, lbText9);
miscTable.setWidget(3, 2, txtText9);
miscTable.setWidget(3, 3, lblText10);
miscTable.setWidget(3, 4, lbText10);
miscTable.setWidget(3, 5, txtText10);
miscTable.setWidget(3, 6, lblText11);
miscTable.setWidget(3, 7, lbText11);
miscTable.setWidget(3, 8, txtText11);
miscTable.setWidget(3, 9, lblText12);
miscTable.setWidget(3, 10, lbText12);
miscTable.setWidget(3, 11, txtText12);
//
miscTable.setWidget(4, 0, lblText13);
miscTable.setWidget(4, 1, lbText13);
miscTable.setWidget(4, 2, txtText13);
miscTable.setWidget(4, 3, lblText14);
miscTable.setWidget(4, 4, lbText14);
miscTable.setWidget(4, 5, txtText14);
miscTable.setWidget(4, 6, lblText15);
miscTable.setWidget(4, 7, lbText15);
miscTable.setWidget(4, 8, txtText15);
miscTable.setWidget(4, 9, lblText16);
miscTable.setWidget(4, 10, lbText16);
miscTable.setWidget(4, 11, txtText16);
//
miscTable.setWidget(5, 0, lblText17);
miscTable.setWidget(5, 1, lbText17);
miscTable.setWidget(5, 2, txtText17);
miscTable.setWidget(5, 3, lblText18);
miscTable.setWidget(5, 5, lbText18);
miscTable.setWidget(5, 5, txtText18);
miscTable.setWidget(5, 6, lblText19);
miscTable.setWidget(5, 7, lbText19);
miscTable.setWidget(5, 8, txtText19);
miscTable.setWidget(5, 9, lblText20);
miscTable.setWidget(5, 10, lbText20);
miscTable.setWidget(5, 11, txtText20);       
FlowPanel miscFlowPanel = new FlowPanel();
miscFlowPanel.add(ehr_noTable);
miscFlowPanel.add(miscTable);
DisclosurePanel miscPanel = new DisclosurePanel("search criteria - misc");
miscPanel.setContent(miscFlowPanel);
miscPanel.setWidth("100%");
return miscPanel;

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/hGOLvKT1TWMJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment