RE: [flexcoders] Re: ArrayCollection.filterFunction assigned but returns null

2007-02-28 Thread Brian Holmes
I'd imagine there is something wrong with the logic. The way I think
about filterFunction is that it inspects each
Item in a collection and says yes or no. If it's returning null, the
evaluation is flawed.


Brian..

 

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ben.clinkinbeard
Sent: Tuesday, February 27, 2007 7:29 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: ArrayCollection.filterFunction assigned but
returns null

Anyone?


--- In flexcoders@yahoogroups.com, ben.clinkinbeard
[EMAIL PROTECTED] wrote:

 I've got a filterFunction assigned, the DataGrid that is bound to the 
 ArrayCollection shows the correctly filtered list, and debugging shows

 that the source Array has 10 items while the collection only has 3.
 However, myCollection.filterFunction returns null.
 
 Anyone have an idea of what could be going on here?
 
 TIA,
 Ben





 Yahoo! Groups Sponsor ~--
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/lOt0.A/hOaOAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links





***
The information in this e-mail is confidential and intended solely for the 
individual or entity to whom it is addressed.  If you have received this e-mail 
in error please notify the sender by return e-mail delete this e-mail and 
refrain from any disclosure or action based on the information.
***


[flexcoders] Re: ArrayCollection.filterFunction assigned but returns null

2007-02-27 Thread ben.clinkinbeard
Anyone?


--- In flexcoders@yahoogroups.com, ben.clinkinbeard
[EMAIL PROTECTED] wrote:

 I've got a filterFunction assigned, the DataGrid that is bound to the
 ArrayCollection shows the correctly filtered list, and debugging shows
 that the source Array has 10 items while the collection only has 3.
 However, myCollection.filterFunction returns null.
 
 Anyone have an idea of what could be going on here?
 
 TIA,
 Ben





[flexcoders] Re: ArrayCollection.filterFunction assigned but returns null

2007-02-27 Thread bobignacio
Any chance to post your source code?


--- In flexcoders@yahoogroups.com, ben.clinkinbeard
[EMAIL PROTECTED] wrote:

 Anyone?
 
 
 --- In flexcoders@yahoogroups.com, ben.clinkinbeard
 ben.clinkinbeard@ wrote:
 
  I've got a filterFunction assigned, the DataGrid that is bound to the
  ArrayCollection shows the correctly filtered list, and debugging shows
  that the source Array has 10 items while the collection only has 3.
  However, myCollection.filterFunction returns null.
  
  Anyone have an idea of what could be going on here?
  
  TIA,
  Ben
 




[flexcoders] Re: ArrayCollection.filterFunction assigned but returns null

2007-02-27 Thread ben.clinkinbeard
Unfortunately no. The problematic code is part of a fairly complex
application where the filtering is configured and assigned in a
component that simply receives a reference to a DataGrid and applies
filters to the dataProvider based on UI selections.

I was unable to reproduce the issue in a simple test project, which
implies the issue lies elsewhere, but I just don't understand how I
could be seeing the values and results I am and still have null be
returned.

Thanks,
Ben


--- In flexcoders@yahoogroups.com, bobignacio [EMAIL PROTECTED] wrote:

 Any chance to post your source code?
 
 
 --- In flexcoders@yahoogroups.com, ben.clinkinbeard
 ben.clinkinbeard@ wrote:
 
  Anyone?
  
  
  --- In flexcoders@yahoogroups.com, ben.clinkinbeard
  ben.clinkinbeard@ wrote:
  
   I've got a filterFunction assigned, the DataGrid that is bound
to the
   ArrayCollection shows the correctly filtered list, and debugging
shows
   that the source Array has 10 items while the collection only has 3.
   However, myCollection.filterFunction returns null.
   
   Anyone have an idea of what could be going on here?
   
   TIA,
   Ben
  
 





[flexcoders] Re: ArrayCollection.filterFunction assigned but returns null

2007-02-27 Thread bobignacio
I just recently dealt with the filterFunction and had a struggle with
it as well. Let's say for example:

/*
 * Filter for a first name
 *
 * @param collectionObj the entire ArrayCollection/XMLListCollection
 */
private function firstNameFilter(collectionObj:Object):Boolean {
 return obj.id == 'Bob';
}

In my case, I remember having a fairly complicated return condition
where it actually didn't return a Boolean but an Object by accident.
The collectionObj is actually the entire ArrayCollection which is
compared to your return statement and if an element qualifies, it will
return true for each element in the List. However, if the condition is
not returning a Boolean but an Object, you may just get a null. And
even if the filterFunction returns null, the dataProvider in your
datagrid may just be displaying the data cuz the condition was never
returning a Boolean in the first place which may be what is happening.

I ended up putting a trace statment inside the filterFunction to
actually examine the collectionObj and I found that I was returning an
Object and not a Boolean value.

Hope this helps...

Bob I.

--- In flexcoders@yahoogroups.com, ben.clinkinbeard
[EMAIL PROTECTED] wrote:

 Unfortunately no. The problematic code is part of a fairly complex
 application where the filtering is configured and assigned in a
 component that simply receives a reference to a DataGrid and applies
 filters to the dataProvider based on UI selections.
 
 I was unable to reproduce the issue in a simple test project, which
 implies the issue lies elsewhere, but I just don't understand how I
 could be seeing the values and results I am and still have null be
 returned.
 
 Thanks,
 Ben
 
 
 --- In flexcoders@yahoogroups.com, bobignacio bobignacio@ wrote:
 
  Any chance to post your source code?
  
  
  --- In flexcoders@yahoogroups.com, ben.clinkinbeard
  ben.clinkinbeard@ wrote:
  
   Anyone?
   
   
   --- In flexcoders@yahoogroups.com, ben.clinkinbeard
   ben.clinkinbeard@ wrote:
   
I've got a filterFunction assigned, the DataGrid that is bound
 to the
ArrayCollection shows the correctly filtered list, and debugging
 shows
that the source Array has 10 items while the collection only
has 3.
However, myCollection.filterFunction returns null.

Anyone have an idea of what could be going on here?

TIA,
Ben