That looks good. Alternatively, you can use a CachedTableModel or just implement your own version of a cache in your TableModel. That way you can refresh the table without sending an RPC request. Thanks, John LaBanca [email protected]
On Tue, May 12, 2009 at 12:30 PM, jay <[email protected]> wrote: > > I allow my users to change which columns are hidden, and which are > visible. > > When the table is initially created, I'm calling setColumnVisible() on > the DefaultTableDefinition, according to the last saved state. Now, > when the user changes the visibility setting for a column, I need to > show or hide that column. Simply calling > DefaultTableDefinition::setColumnVisible() doesn't actually do > anything. > > Here's what I've done...please let me know if there's a better way: > > In a PST subclass I have created a refresh() method: > > public void refresh() { > List<RowType> rows = new ArrayList<RowType>( getRowValues() ); > setData( getAbsoluteFirstRowIndex(), rows.iterator() ); > } > > This does the trick (especially as it does not require that I go back > to the server for the data!). However, is this the best way? > > Thanks, > > jay > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
