PDA

View Full Version : storeRemove not getting called while using Remove all Button in DualListField



pras.nr
24 Jul 2010, 4:50 AM
I am using the following piece of code to track changes to the toStoreField
It is able to track items removed using the drag functionality and also by using
remove selected button.

However it does not work for Remove All button.


public void storeRemove(StoreEvent<BeanModel> se) {

super.storeRemove(se);
BeanModel u = se.getModel();
//perform some operation

}
}

Thereafter I tried to use the following piece of code
which gives a null pointer error when the remove all button is used
because e.getModel() is returned as null. If I use
e.getModels() method then it works only for the Remove All button option and
gives a null error in all other cases.


public void handleEvent(StoreEvent<BeanModel> e) {

BeanModel u = e.getModel();
super.handleEvent(e);
}

sven
24 Jul 2010, 5:06 AM
removeAll clears the store, so you need to listen to the Clear event.