Hi,

I have the following problem. I have a celltable with 2 columns. These
columns contain Filenames and their size.
Due to the fact that i have many files that i want to display I want
to use Paging. In my last project i used gwt 2.1 and the paging worked
there. The simplePager in GWT 2.2 does not work in my new project but
its still the same code that should work.
Can anyone show me where it goes wrong? Thanks.

Here“s my code reduced to the SimplePager things:

public class CellTableTestClass {

    private VerticalPanel applicationPanel = new VerticalPanel();
    private CellTable<LogData>  cellTable = new CellTable<LogData>();
    private SingleSelectionModel<LogData> selectionModel = new
SingleSelectionModel<LogData>();

        public VerticalPanel createContent() {

                LogFileServiceAsync initData = (LogFileServiceAsync)
GWT.create(LogFileService.class);

                initData.getLogs(new AsyncCallback<List <LogData>>() {

                        public void onFailure(Throwable caught) {
                                Window.alert(caught.getLocalizedMessage());

                        }

                        public void onSuccess(List<LogData> result) {
                                cellTable.setRowData(result);
                        }

                });

                 cellTable.setSelectionModel(selectionModel);

                {
                    cellTable.addColumn(new TextColumn<LogData>() {

                        @Override
                        public String getValue(LogData object) {
                            return object.getLogName();
                        }

                    }, "Log Name");

                    cellTable.addColumn(new TextColumn<LogData>() {

                        @Override
                        public String getValue(LogData object) {
                            return object.getSize();
                        }

                    }, "Size");

                }

                // create a pager, giving it a handle to the CellTable
                SimplePager.Resources pagerResources =
GWT.create(SimplePager.Resources.class);
                SimplePager pager = new SimplePager(TextLocation.CENTER,
pagerResources, false, 0, true);

                pager.setDisplay(cellTable);
                pager.setPageSize(10);

                    // add the Pager to the dialog
                applicationPanel.add(pager);

                applicationPanel.add(new HTML("<hr />"));

                applicationPanel.add(cellTable);


                return applicationPanel;
        }

}

-- 
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.

Reply via email to