missing rows in gridlist

hello All,

I use GwtRpcDataSource. When I get rows from server, its flashing for a short time(1-2sec), and hides.
After it “No items to show” is appearing. If I refresh it, sometimes working well, sometimes hiding the rows. It is very stochastic.
I get a correct rowset from server, all of case.

here is my code snippets:

      service.fetch (dataSourceRequest, new AsyncCallback<Response>() {

            @Override
            public void onFailure (Throwable caught) {
                 ...
            }

            @Override
            public void onSuccess (Response result) {
                try {
                    if (result instanceof ListResponse) {
                        int size = ((ListResponse)result).getRows().size ();
                        ListGridRecord[] list = new ListGridRecord[size];
                        if (size > 0) {
                            for (int i = 0; i < size; i++) {
                               ListGridRecord record = new ListGridRecord ();
                               copyValues ((DTO)((ListResponse)result).getRows().get(i), record);
                               list[i] = record;
                            }
                        }
                        response.setStatus(RPCResponse.STATUS_SUCCESS);
                        response.setStartRow(startRow);
                        response.setEndRow(endRow);
                        response.setTotalRows (((ListResponse)result).getTotalAmountOfRows());
                        response.setData (list);
                        processResponse (requestId, response);
                    }
                    else {
                             ...
                    }
                }
                catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });

test state:
number of rows: 18
startRow:0
endRow:19

thx
Zamek

Hi,

Looks like your code is incomplete: how do you set values for startRow and endRow in

response.setStartRow(startRow);
response.setEndRow(endRow);

?

Alius

Its coming back from server, values:

startRow:0
endRow:19

and server gets it from request(smartgwt).

there are 18 records in result.
startRow is 0, endRow is 19.

There is only 18 records in result set. Why does your startRow==0 and endRow==19 ?
I think those should be startRow==0 and endRow==17.

PS. I did not set startRow and endRow in my example http://forums.smartclient.com/showpost.php?p=19473&postcount=15
Try to remove these lines.

Alius

startrow

I would like to make progressive load ( http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#search%3Dstartrow ) it said:

“However, the ResultSet does not require that the server calculate the true length of the dataset, which can be costly for an extremely large, searchable dataset. Instead, the server may simply advertise a totalRows value that is one page larger than the last row loaded. This results in a UI sometimes called “progressive loading”, where the user may load more rows by scrolling past the end of the currently loaded rows, but is not allowed to skip to the end of the dataset.”

Solved

Oh, Its solved. I made a mistake in a server side, sometimes the resultset was empty:)

Thanks a lot for help

Zamek