PDA

View Full Version : Grid Page Size Dynamically Updated, then a Refresh causes continuous "Refresh"



jmhwhite2001
21 May 2009, 7:06 AM
Ok, the subject might not explain what my problem is, but I'm making the page size configurable. Since service calls are Asynchronous, I'm having to set the page size after the pagingtoolbar has been created, so here's the code:




service.getPageSize(new AsyncCallback() {
public void onFailure(Throwable caught) {
Dialog errorDialog = new Dialog();
errorDialog.setHeading("Error");
errorDialog.setButtons(Dialog.OK);
errorDialog.setBodyStyleName("pad-text");
errorDialog.addText("An error occurred: " + caught.getMessage() + "<p>" + "Please contact your system administrator.");
errorDialog.setScrollMode(Scroll.AUTO);
errorDialog.setHideOnButtonClick(true);
errorDialog.show();
}

public void onSuccess(Object result) {
pageSize = ((Integer) result).intValue();

toolBar.setPageSize(pageSize);
toolBar.refresh();
}

});


I'm aware that once a page size is set after the toolbar is created, you won't see the new page size until the user changes to a next page or refreshes the data.

So, when the refresh occurs, the grid shows the right data, but the refresh icon goes on an on (as if it's still refreshing) and it seems like I'm getting the disable effect because the color scheme seems to "dim," but I can still select the paging icons to go to the next page.

Any thoughts??

Screenshot is attached regarding the paging toolbar. Unfortunately, I don't have any movie record software or I would show a video of what's happening. The screenshot doesn't show the data, which has already been displayed perfectly. I do notice that the refresh causing a "Loading" message to appear, which is cool. The constant refresh icon and the dimming of that section is an issue.

Thanks!