Oops, yes it was a typo on my part, I tried to make a couple changes
as I thought I had an idea. testFilter in the error message should be
arrayFilter.

When i sat down though this morning and looked at it again I realized
the problem was in my yesterday I was trying to do things backwards
and make a search() go through an int and converting the searchBar
text to an int when I should have been converting the contactID to a
string and leaving the searchBar alone.


--- In [email protected], "Matt Chotin" <[EMAIL PROTECTED]> wrote:
>
> 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::dispatchEven
> tFunction()
> 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 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to