PDA

View Full Version : Paging toolbar appears disabled but data is displayed



googelybear
26 Aug 2009, 4:41 AM
Hi,

I'm using the paging toolbar with a grid. Sometimes all the buttons on the paging toolbar start appearing disabled (greyed out) , but there is still more data available. Even though the buttons have the disabled style they can still be clicked on and used (and work) normally. To better illustrate this problem I uploaded the following screenshot: http://www.box.net/shared/s9b9gq4v6r

Do you have any idea why this is happening? So fare I could only observe it in IE.

Arno.Nyhm
26 Aug 2009, 6:17 AM
i had the same problem and find out that i have called some loaders and other things twice and then it happened this masking. i called a loader.load() and a pagingtoolbar.setActivePage(1). it fires twice the load event.

googelybear
26 Aug 2009, 8:25 AM
I never called toolbar.setActivePage myself, only loader.load...

Arno.Nyhm
26 Aug 2009, 10:31 AM
track your loading for the case it is loaded twice from somewhere else... otherwise i have no idea...

googelybear
27 Aug 2009, 7:09 AM
hmmm...I followed your advice and did some deeper inspection and I think you are right - something is fishy here!
My problem seems to be that I have a checkbox that controls if only admin users are displayed (if checked -> display only admin users otherwise display all users). This checkbox has a listener registered for change events as follows (very simple):


adminOnlyCheckBox.addListener(Events.Change, new Listener<BaseEvent>() {

public void handleEvent(BaseEvent be) {
reloadGridFull(); // this will re-calculate the total nr. of matching users and call loader.load(0, pageSize);
}
});
BUT: This change event seems to be buggy! It is not only triggered when the checkbox has been clicked but also on other - mysterious for me! - occasions (e.g. click in the grid after clicking on the checkbox -> boom!, 2nd change event triggered) which might cause overlapping calls (because backend calls to fetch the data are asynchronous) and therefore might confuse the grid/paging.

Can anyone make sense of this weird behavior??? *confused*

sven
27 Aug 2009, 7:11 AM
This is a known issue of checkbox. There is no fix available.

googelybear
27 Aug 2009, 7:57 AM
thanks for clarifying this issue- as a workaround until this is fixed I will use a ToggleButton.
It's a little bit surprising that such a bug still exists in version 2 of a ui library.