Why is the error in a textFilter function when you’re writing arrayFilter?  Typo in your post?

 

Run this in the debugger so you get more info including a line number in the error.  You’ll probably find the line and it may be that the contactID isn’t an object with a search function or something like that?  The debugger could be useful here too, put a breakpoint in your filter function and you’ll see how things go.

 


From: [email protected] [mailto:[email protected]] On Behalf Of camlinaeizerous
Sent: Thursday, November 02, 2006 8:22 AM
To: [email protected]
Subject: [flexcoders] Issue while tring to filter an arrayCollection...

 

my first attempt at this post got filtered out for some reason and the
rich text editor just crashed on my when I attempted to submit so here
is attempt 3.

myParticipants and arrayColleciton is populated by a cfquery that
pulls the entire contents of a sql table. There are 4 column one being
contactID int/int and the 3 others are strings/varhchars. I also have
searchBar a textInput that on change calls the filtering function so
it filters as you type. I recieve the following runtime error when i
attempt to filter comparing the contactID:

TypeError: Error #1006: value is not a function.
at views::viewParticipants_Contacts/::textFilter()
at mx.collections::ListCollectionView/::internalRefresh()
at mx.collections::ListCollectionView/refresh()
at views::viewParticipants_Contacts/::filterHandler()
at views::viewParticipants_Contacts/__searchBar_change()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.controls::TextInput/::textField_changeHandler()

the following snipet is the code I'm using as the filter where
(item.contactID.search(searchBar.text) >= 0) is causing the issue but
when I replace contactId with any of the other 3 columns it works just
as intended. I attmepted changing seachBar.text as int and a few other
things but without success.

private function filterHandler():void
{
this.myParticipants.filterFunction = arrayFilter;
this.myParticipants.refresh();
}
private function arrayFilter(item:Object):Boolean
{
if((searchBar.text == "") ||
(item.contactID.search(searchBar.text) >= 0))
{return true;}
else
{return false;}
}

Some help resolving this issue without changing the sql column to a
string would be greatly appreciated.

__._,_.___

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





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to