PDA

View Full Version : Liststore filter Problem



antoinereveillon
28 May 2009, 1:11 AM
Hi all,

I have a Grid populated with a ListStore, and I try to apply different filter to this ListStore in order to have different views in my grid so nothing complicated.

If I put a button with my filter inside the componentSelected method, it works well, but if I insert a Filter at the application launch it does'nt work anymore. Here is my code :



LeftListStore = new ListStore<CbRef>();
LeftListStore = CbScreener.getDaoManager().getCbStore(); // we get the data

filterCbsLeftGrid = new StoreFilter<CbRef>(){
public boolean select(Store<CbRef> store,CbRef parent, CbRef item, String property) {

if( property == "INIT"){
return false;
}
}
LeftListStore.addFilter(filterCbsLeftGrid);
LeftListStore.filter("INIT");


And I have this error :



com.google.gwt.core.client.JavaScriptException: (TypeError):Cet objet ne gère pas cette propriété ou cette méthode
number: -2146827850
description: Cet objet ne gère pas cette propriété ou cette méthode
at com.google.gwt.dom.client.Element$.getElementsByTagName$(Native Method)
at com.extjs.gxt.ui.client.widget.grid.GridView.getCell(GridView.java:329)
at com.extjs.gxt.ui.client.widget.grid.GridView.ensureVisible(GridView.java:770)
at com.extjs.gxt.ui.client.widget.grid.GridView.focusCell(GridView.java:294)
at com.extjs.gxt.ui.client.widget.grid.GridView.focusRow(GridView.java:309)
at com.extjs.gxt.ui.client.widget.grid.GridView.insertRows(GridView.java:1206)
at com.extjs.gxt.ui.client.widget.grid.GridView.onAdd(GridView.java:1210)
at com.extjs.gxt.ui.client.widget.grid.GridView$5.storeAdd(GridView.java:1093)
at com.extjs.gxt.ui.client.store.StoreListener.handleEvent(StoreListener.java:22)
at com.extjs.gxt.ui.client.store.StoreListener.handleEvent(StoreListener.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:100)
at com.extjs.gxt.ui.client.store.ListStore.insert(ListStore.java:445)
at com.extjs.gxt.ui.client.store.ListStore.insert(ListStore.java:263)
at com.extjs.gxt.ui.client.store.ListStore.add(ListStore.java:148)
at com.bnpparibas.eqd.cbresearch.cbscreener.client.DaoManager.updateCbsStore(DaoManager.java:348)
at com.bnpparibas.eqd.cbresearch.cbscreener.client.DaoManager.updateStores(DaoManager.java:403)
at com.bnpparibas.eqd.cbresearch.cbscreener.client.DaoManager$19.onSuccess(DaoManager.java:435)
at com.bnpparibas.eqd.cbresearch.cbscreener.client.DaoManager$19.onSuccess(DaoManager.java:1)
at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:215)
at com.google.gwt.http.client.Request.fireOnResponseReceivedImpl(Request.java:264)
at com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch(Request.java:236)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:227)



Am I doing something wrong ?

Thanks in advance for your advices.

richardcatlin
19 Sep 2010, 7:19 AM
try:
LeftListStore.applyFilters(null);
this worked for me.

sven
19 Sep 2010, 7:32 AM
This exception should already be fixed. Add event should not anymore be fired with null values.