Hi,

We are having problems getting the SimplePager to work.
The pager is shown, but it doesn't work - as if it is not initialized
correctly with the data, somehow.

The java code looks like this:

public class RunProgressPopupPanel extends DialogBox {

        private final String dateFormat = "yyyy.MM.dd HH:mm:ss";

        public interface Binder extends UiBinder<Widget,
RunProgressPopupPanel> {}
        private static Binder uiBinder = GWT.create(Binder.class);
        private ListDataProvider<StepProgress> dataProvider = new
ListDataProvider<StepProgress>();

        @UiField CellTable<StepProgress> cellTable;
        @UiField SimplePager pager;

        // (provided = true)

        public RunProgressPopupPanel(){
                super(false, Global.POPUPS_ARE_MODAL);
                setWidget(uiBinder.createAndBindUi(this));

                initTableColumns();
        }

        private void initTableColumns(){
                // Connect the table to the data provider.
                dataProvider.addDataDisplay(cellTable);

                //SimplePager.Resources pagerResources =
GWT.create(SimplePager.Resources.class);
                //pager = new SimplePager(TextLocation.CENTER, pagerResources,
false, 0, true);


                pager = new SimplePager();
                pager.setRangeLimited(false);
                pager.setDisplay(cellTable);
        //pager.setPageSize(10);

               ---
               ---
                ---


        public void show(String title, RunProgress p){
                this.setText(title);

                if (dataProvider.getDataDisplays() == null ||
dataProvider.getDataDisplays().isEmpty()) {
                        dataProvider.addDataDisplay(cellTable);
                }
                dataProvider.getList().clear();
                dataProvider.getList().addAll(p.steps);
                cellTable.setRowCount(p.steps.size());
                GWT.log("p.steps:"+ p.steps.size());
            cellTable.redraw();

            this.setPopupPosition(400, 200);
            this.show();
        }

        public void updateProgress(RunProgress p) {
                dataProvider.getList().clear();
                dataProvider.getList().addAll(p.steps);
                GWT.log("p.steps:"+ p.steps.size());
                cellTable.setRowCount(p.steps.size());
            cellTable.redraw();
        }


The UIBinder xml looks like this:

<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
        xmlns:g="urn:import:com.google.gwt.user.client.ui"
        xmlns:c="urn:import:com.google.gwt.user.cellview.client">

        <g:HTMLPanel>
                <g:VerticalPanel horizontalAlignment="center" spacing='10'
width="700px">
                        <c:CellTable width="100%" ui:field="cellTable" 
pageSize='6'/>
                        <c:SimplePager ui:field="pager" location="CENTER"/>
                        <g:Button ui:field="btnOk">Ok</g:Button>
                </g:VerticalPanel>
        </g:HTMLPanel>
</ui:UiBinder>






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