Using one of the concrete classes AsyncDataProvider or ListDataProvider whose base class is AbstractDataProvider provides a very efficient mechanism for accessing your widget's underlying data source as well as for manipulating the display of the data itself.
Once a ListDataProvider is setup you can do similar to below: dataProvider.getList().add(someObjectsList); // add a new SomeObject to the list sortSomeObjectsList(dataProvider.getList()); // call a method to sort the list dataProvider.refresh(); // tell all widgets using the data provider to refresh themselves because the data has changed You can also add & replace lists in a ListDataProvider with: dataProvider.setList(someObjectsList); To set up a ListDataProvider: ListDataProvider<SomeObject> dataProvider = new ListDataProvider<SomeObject>(); // strongly typed declaration - notice the use of type T in the declaration which is the type specifier for the type of objects in the list dataProvider.setList(someObjectsList); // the list of objects to be provided by the ListDataProvider dataProvider.addDataDisplay(myCellWidget); // the widget the ListDataProvider is providing the data to Jeff On Mon, Nov 8, 2010 at 1:22 PM, John LaBanca <[email protected]> wrote: > You can push new data into the widget using CellTable#setRowData() in > conjunction with CellTable#setRowCount(). If you want to clear the data > first, do the following: > myCellTable.setRowCount(0); // Clears all data > myCellTable.setRowCount(20, true); // Set the size of the new data > myCellTable.setRowData(0, myData); // Set the new data > > In GWT 2.1.1, there is a new method CellTable#setRowData(List) that clears > all existing data and replaces it with the specified list. > > Thanks, > John LaBanca > [email protected] > > > > On Mon, Nov 8, 2010 at 5:13 AM, alf <[email protected]> wrote: > >> we are render a celltable widget nice when i push a boton. the >> problems is when i will push the botton again i create other widget >> and adding. How can clear all item adn populate the sam widget with >> new datas. >> >> thanks and excuse for by bad english ans newbie question i have spent >> hours fiding examples in doc >> >> al >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Web Toolkit" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<google-web-toolkit%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/google-web-toolkit?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > -- Jeff -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
