I've set my table resize policy to UNCONSTRAINED. I then very
carefully setup my ColumnDefinitions to have the right preferred size
(because the user may have previously resized the columns, and I need
to honor that size).

What I've noticed, though, is that "out-of-the-box", my columns are
*always* 80px wide (which seems to correspond to
FixedWidthGrid.DEFAULT_COLUMN_WIDTH.

It seems to me (and please...correct me if I'm misusing/abusing the
PagingScrollTable) that when I set the table definition, it should be
setting the column widths to their preferred size, rather than
allowing the default size to kick in.

FWIW, my work-around is to override setTableDefinition() as follows:

  @Override
  public void setTableDefinition(
    TableDefinition<RowType> tableDefinition
  ) {
    super.setTableDefinition( tableDefinition );
    refreshVisibleColumnDefinitions();

    List<ColumnDefinition<RowType, ?>> columns =
getVisibleColumnDefinitions();
    for ( int index = 0, numCols = columns.size(); index < numCols;
index++ ) {
      setColumnWidth( index, columns.get
( index ).getPreferredColumnWidth() );
    }
  }

Would problems be caused if this behavior was in the base class? (My
goal is to have the PagingScrollTable "just work". I'll be the first
to admit that what I consider "just working" may not work for
others...)

thanks,

jay
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to