Yep, that is what you're doing. Sorry for my failure at reading
comprehension. :)

I can certainly see why you would have that expectation for an
"unconstrained" table. And if I'm reading John's "probably a bug"
comment correctly, then it sounds like that might be a good thing to
enter in the issue tracker.

And your comments are certainly welcome. Feedback is always needed,
especially in the incubator.


On Mon, May 11, 2009 at 4:11 PM, jay <[email protected]> wrote:
>
> Yes! When the table width is unconstrained, I want it to honor the
> preferred width of every column.
>
> If you glance back at my original post, you'll see that I'm doing
> exactly what you suggest :-) It's just that this was surprising to me,
> and required more work than I think ought to be needed.
>
> (I understand that this widget is still in the incubator... I hope
> that my comments are coming across as helpful, because I really am
> trying to be helpful, and not critical. I chalk all of this up to
> "hey...let's throw something out there, and see what else needs to be
> done.")
>
> thanks!
>
> jay
>
> On May 11, 11:31 am, Isaac Truett <[email protected]> wrote:
>> Jay,
>>
>> Am I right in understanding that you're expecting the table, when
>> unconstrained, to grow until each column can occupy its preferred
>> width? It should be possible to achieve that, although just setting
>> preferred size may not be enough. There used to be a setColumnWidth()
>> method that would set a column's size, but still allow it to be
>> resized later. I don't know what the gen2 PST equivalent would be, but
>> I can dig around a bit later if I get some time.
>>
>>
>>
>> On Mon, May 11, 2009 at 1:14 PM, jay <[email protected]> wrote:
>>
>> > But if I set the min and max sizes, then the user cannot resize the
>> > columns. And...well, my users need to be able to resize the columns...
>>
>> > So, I guess I should enter a feature request (or else provide a
>> > patch ;-) that there some way for the table to set the initial column
>> > width to the preferred width.
>>
>> > jay
>>
>> > On May 7, 6:08 pm, John LaBanca <[email protected]> wrote:
>> >> If you want the columns to be an exact size, set the minimum and maximum
>> >> column widths and call resetColumnWidths() or set the resize policy to
>> >> FIXED.
>> >> The preferred width is exactly that, the width that the columns should
>> >> attempt to maintain if they can.  When the resize policy is set to
>> >> FILL_WIDTH, the table will update the column widths on every page load.
>> >>  When it is set to anything else, you must update the width manually
>> >> (although that is probably a bug).  Either way, the preferred width is not
>> >> guaranteed, but the minimum and maximum widths are.
>>
>> >> Thanks,
>> >> John LaBanca
>> >> [email protected]
>>
>> >> On Thu, May 7, 2009 at 7:11 PM, jay <[email protected]> wrote:
>>
>> >> > 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