PDA

View Full Version : [FNR] PagingToolBar isn't BeforeLoad cancel aware



foal
16 Oct 2010, 4:56 AM
Hi,

GXT 2.2.0

Looks like the current implementation of PagingToolBar does't aware on cancel in BeforeLoad event. So if some listener will cancel BeforeLoad event the loadel will not load data and PagingToolBar will disable forever.

Regards,
Stas

sven
18 Oct 2010, 7:10 AM
Fixed in SVN as of revision 2277

foal
18 Oct 2010, 10:34 PM
The same thing is in com.extjs.gxt.ui.client.store.ListStore<M> implementation. It doesn't take into account that LoadEvent may by canceled already.



protected void onBeforeLoad(LoadEvent le) {
if (!fireEvent(BeforeDataChanged, createStoreEvent())) {
le.setCancelled(true);
}
}

sven
19 Oct 2010, 5:13 AM
Fixed that too for ListStore and TreeStore. Change is in SVN at revision 2279

4723
15 Nov 2010, 6:30 AM
In my opinion it is necessary to support two-phase route of this event.
First of all components should respond to the question of whether they agree to changes in the Store and start Loader (BeforeLoad event and BeforeChange). At this stage, the control should not change its state ("load in progress", "disable" etc. ) but only canceling this event.
Successful completion of the first stage should fire the second event (for example LoadAccepted and StoreChangedAccepted) which components should react.
In the present state, the component which has been registered as the first did not become aware of the fact that the component which has been registered as the second canceled "BeforeLoad" event.

sven
15 Nov 2010, 6:32 AM
We are planning in implementing this change in a future version.