Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

fetchData on dataSource causes tooltips to disappear

$
0
0
Hi

I'm using multiple datasources in my application to periodically update my listgrids and retrieve my current server status.
After spending a few hours trying to fix a visual error in my application i now think that there must be a bug in the fetchData() method.

I'm calling the following method once every 5 seconds using a timer to periodically update one of my listgrids:

Code:

private void updateLogsGrid() {
        DataSource dataSource = logsGrid.getDataSource();

        Criteria criteria = logsGrid.getCriteria();
        Integer[] visibleRows = logsGrid.getVisibleRows();

        // request one page's worth of data on either side of the current viewport
        Integer startRow = visibleRows[0] - logsGrid.getResultSet().getResultSize();
        Integer endRow = visibleRows[1] + logsGrid.getResultSet().getResultSize();
        if (startRow < 0) {
                startRow = 0;
        }

        DSRequest request = new DSRequest();
        request.setStartRow(startRow);
        request.setEndRow(endRow);
        request.setSortBy(logsGrid.getSort());

        dataSource.fetchData(criteria, new DSCallback() {

                @Override
                public void execute(DSResponse response, Object rawData, DSRequest request) {

                        DataSource dataSource = logsGrid.getDataSource();
                        ResultSet resultSet = new ResultSet(dataSource);
                        resultSet.setInitialLength(response.getTotalRows());

                        // correctly position the result in the resultset's cache
                        Record[] result = response.getData();
                        Record[] initialData = new Record[response.getTotalRows()];
                        System.arraycopy(result, 0, initialData, response.getStartRow(), result.length);
                        resultSet.setInitialData(initialData);

                        resultSet.setInitialSort(logsGrid.getSort());
                        resultSet.setCriteria(logsGrid.getCriteria());
                        logsGrid.setData(resultSet);
                }
        }, request);
}

Everytime a request is made, the currently displayed tooltip disappears.
This occurs while hovering over any item that displays a tooltip, even ones that are completely unrelated to the updated listgrid (not even members of the same Layout).
I did not move the mouse once the tooltip was showing.

As a initially mentioned i have to periodically update multiple dataSources the same way i posted above.
This means that tooltips are quite useless in my application at the moment, since some of them are quite long and can't be read if they are only displayed a few seconds.


I tried to isolate the problem and disabled every periodically updating datasource and other functionality causing requests beeing made.

I changed the code from above to this minimalistic example:

Code:

private void updateLogsGrid() {
        DataSource dataSource = logsGrid.getDataSource();
        Criteria criteria = logsGrid.getCriteria();

        DSRequest request = new DSRequest();

        dataSource.fetchData(criteria, new DSCallback() {

                @Override
                public void execute(DSResponse response, Object rawData, DSRequest request) {

                }
        }, request);
}

Using this implementation i get the same weird behaviour, even i do not actually do anything besides making the request.


EDIT:
forgot to mention the versions:
GWT - 2.6.1
SmartGWT - 5.0p

Viewing all articles
Browse latest Browse all 4756

Trending Articles