pombreda / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
0 stars 0 forks source link

ScrollTable column width problem: width of the solumns does not match the width of ScrollTable #221

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version of gwt and gwt-incubator are you using?
GWT - 1.5.3 and GWT incubator 1.5 (Dec 2008)

What OS and browser are you using?
Windows

Do you see this error in hosted mode, web mode, or both?
Hosted mode, Web mode when using IE

(If possible, please include a test case that shows the problem)
I didn't find when exactly error occurs. 
I add ScrollTable to some container, set ResizePolicy to FILL_WIDTH, but 
width of it is smaller than container's width.
And when I resize container, width of table gets smaller and smaller.

Workaround if you have one:
The source of the problem I found:
Sometimes in IE the width of the table is not the same as sum of the width
of all columns.

in method AbstractScrollTable.fillWidth diff variable is calculated.
diff = clientWidth - headerTable.getElement().getScrollWidth();

I changed code in AbstractScrollTable to fix the problem.
now calculate diff not using scrollWidth property of the tables, but suming
all widths for all columns:

List<ColumnWidthInfo> colWidthInfos = getColumnWidthInfo(0, numColumns);
int totalWidth = 0;
for (ColumnWidthInfo wi : colWidthInfos) {
    totalWidth += wi.getCurrentWidth();
}
diff = clientWidth - totalWidth;

Thank you!

Original issue reported on code.google.com by evgeny.nacu on 12 Jan 2009 at 1:32

GoogleCodeExporter commented 9 years ago

Original comment by ecc%google.com@gtempaccount.com on 16 Jan 2009 at 2:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi,

I have the same problem with IE6 & IE7 but only if the number of columns is 1 
and the
ResizePolicy is FILL_WIDTH. The problem is that the column width is getting 
smaller
and smaller, see attached Screenshot. 

The problem is that the generated HTML code has two <colgroup>s elements.

One is generated by the FlexTable constructor by calling setColumnFormatter():

  public FlexTable() {
    super();
    setCellFormatter(new FlexCellFormatter());
    setRowFormatter(new RowFormatter());
    setColumnFormatter(new ColumnFormatter());
  }

and the other by the FixedWidthFlexTable condtructor by callingg again
setColumnFormatter():

  public FixedWidthFlexTable() {
    super();

    ...

    setCellFormatter(new FixedWidthFlexCellFormatter());
    setColumnFormatter(new FixedWidthFlexColumnFormatter());
    setRowFormatter(new FixedWidthFlexRowFormatter());

    ...
  }

Attached you can find the patch I use as a workaround.

A demo can be found at: http://69.20.122.77/gwt-mosaic/Showcase.html#CwListBox

Kind Regards,
George.

Original comment by georgopo...@gmail.com on 31 May 2009 at 11:54

Attachments: