I'm using a FilterClass, which holds just the filterFunction and some optional ways to configure the filtering. Every collection, which needs filtering, gets an instance of this FilterClass by assigning collection.filterFunction = filter.filterFunction;
Cheers, Ralf. On 5/24/07, Kevin <[EMAIL PROTECTED]> wrote:
I would like to attempt to separate my filter functions from my view so that I am not duplicating code when two views share similar filter functions. My idea was to create a class that contains a ListCollection and all the appropriate FilterFunctions for that collection. The FilterFunctions would then be applied by methods in that class. The problem I am having is that I can't pass any parameters to the FilterFunction when I assign it to the specific ListCollection. The FilterFunction seems like it needs to be tightly coupled with the view in order to work. To work around this, for application wide filters, I am saving a filter value on my model and then referencing the model from my FilterFunction (which still isn't ideal). However in some cases this isn't appropriate since the filter value doesn't really need to be persisted over the entire application. Does anyone have any thoughts on how to accomplish this? Thanks for the help, Kevin
-- Ralf Bokelberg <[EMAIL PROTECTED]> Flex & Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35