Now I'm really lost.  I don't think there is a filterFunction on an
HTTPService object.

 

initApp() is being called in creationComplete and there's no guarantee
that the service has returned data by then.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of jovialrandor
Sent: Wednesday, September 19, 2007 1:16 PM
To: [email protected]
Subject: [flexcoders] Re: Cannot use 'filterFunction' from an
HTTPService request

 

Alex, I have the results returned in tin initApp function:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " 
layout="vertical"
creationComplete="initApp();" 
backgroundGradientColors="[#c0c0c0, #808080]" 
xmlns:mxeffects="com.adobe.ac.mxeffects.*">

public function initApp():void
{

sanData.filterFunction=processFilter;
sanData.send(); 

}

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> When do yo apply the filter? initApp probably gets called before 
the
> results return.
> 
> 
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>

[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of jovialrandor
> Sent: Wednesday, September 19, 2007 9:09 AM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Cannot use 'filterFunction' from an 
HTTPService
> request
> 
> 
> 
> I want to setup a datagrid that can filter from a textfield. I have 
> data coming back from an API using the HTTPRequest tag. I know the 
> filterFunction only works with ArrayCollection, but I thought that 
> the data returned was in form of a ArrayCollection.
> 
> However when I try to use the following function, it gives me an 
> error.
> 
> public function initApp():void
> {
> 
> // Set filter function // Be careful to set 
> filterFunction // only after ArrayCollection has been // 
> populated. 
> // sanData.filterFunction=processFilter;
> }
> 
> public function processFilter(item:Object):Boolean
> {
> var result:Boolean=false;
> 
> // If no filter text, or a match, then true 
> if (!item.name.length
> || item.Expr2.toUpperCase().indexOf
> (txtFilter.text.toUpperCase()) >= 0)
> result=true;
> 
> return result;
> }
> 
> Here is the HTTP call
> 
> <mx:HTTPService id="sanData" url="someAPI"
> result="sanDataHandler(event)"/>
> 
> Thanks
>

 

Reply via email to