I figured out the solution for anyone interested. After calling the
filter func, call dg.invalidateProperties(), then call refresh().

public function aFilter():void{
    dg.dataProvider.filterFunction = hideViewedNotifsFilterFunc;
    dg.invalidateProperties()
    dg.dataProvider.refresh();
}

Jeff




--- In [email protected], "securenetfreedom" <[EMAIL PROTECTED]> wrote:
>
> When using a filter function on an AdvancedDataGrid whose dp is a
> HierarchicalData object derived from an XMLCollectionList passed into
> it, the dataprovider will not refresh by calling dp.refresh directly.
> 
> So I tried datagrid.dataProvider.refresh() and it works until one of the
> row's criteria for filtering is changed and a subsequent filter request
> occurs. It throws 2 consecutive Invalid Bookmark runtime errors (see
> below). If I press 'Continue' on both errors, the filtering works
> properly.
> 
> Error: Bookmark no longer valid.
>      at
>
ListCollectionViewCursor/seek()[E:\dev\3.0.x\frameworks\projects\framewo\
> rk\src\mx\collections\ListCollectionView.as:2046]
>      at mx.collections::HierarchicalCollectionViewCursor/get
>
current()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\\
> collections\HierarchicalCollectionViewCursor.as:198]
>      at
>
mx.collections::HierarchicalCollectionViewCursor/collectionChangeHandler\
>
()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\collect\
> ions\HierarchicalCollectionViewCursor.as:1056]
> 
> 
> <mx:HTTPService id="svc" url="data/notifications.xml" resultFormat="e4x"
> />
> <mx:XMLListCollection id="dp" source="{svc.lastResult..category}" />
> <mx:HierarchicalData id="categories" source="{dp}" />
> <mx:AdvancedDataGrid id="dg"  dataProvider="{categories}" ... />
> 
> public function aFilter():void{
>   dg.dataProvider.filterFunction = hideViewedNotifsFilterFunc;
>   dg.dataProvider.refresh();
>   // addressing dataprovider directly below does not work
>   //dp.filterFunction = hideViewedNotifsFilterFunc;
>   //dp.refresh();
> }
> 
> Any ideas how to eliminate the runtime errors?
> 
> Thanks,
> 
> Jeff
>


Reply via email to