i have figured it out and it works now. i would like the community's thoughts 
on best practices though. below is the full code. thanks 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
                                layout="vertical"
                                creationComplete="init()">

        <mx:Script>
                <![CDATA[
                        import mx.rpc.events.ResultEvent;
                        import mx.controls.Alert;
                        import mx.managers.CursorManager;
                        import mx.collections.ArrayCollection;
                        
                        private function init():void
                        {
                                
                                archiveSvc.getDocs();
                        
                        }
                        
                        /******************* code to get Archives 
*****************************/
                        [Bindable]
                        private var archiveAr:ArrayCollection=new 
ArrayCollection();
                        
                        private function archiveResult(event:ResultEvent):void
                        {
                                
                                archiveAr=event.result as ArrayCollection;
                        
                        }
                        
                        /******************* Start Filter Functions 
***************************/
                        
                        private var keywordText:String="keywords";
                        private var titleText:String="title";
                        private var subjectText:String="subject";
                        
                        private function filterGrid():void
                        {
                                
                                archiveAr.filterFunction=myFilterFunction;
                                archiveAr.refresh();
                        
                        }
                        
                        private function filterReset():void
                        {
                                
                                archiveAr.filterFunction=null;
                                archiveAr.refresh();
                        
                        }
                        
                        private function myFilterFunction(item:Object):Boolean
                        {
                                
                                //return item[keywordText].match(new 
RegExp(generalSearch.text, 'i'));                          
                                
                                return (item[keywordText].match(new 
RegExp(generalSearch.text, 'i')) && item[titleText].match(new 
RegExp(titleSearch.text, 'i')) && item[subjectText].match(new 
RegExp(subjectSearch.text, 'i')));
                        }
                        
                        private function keywordChangeHandler(event:Event):void
                        {
                                
                                if (generalSearch.text != '')
                                {
                                        filterGrid();
                                }
                        
                        }
                        
                        private function titleChangeHandler(event:Event):void
                        {
                                
                                if (titleSearch.text != '')
                                {
                                        filterGrid();
                                }
                        
                        }
                        
                        private function subjectChangeHandler(event:Event):void
                        {
                                
                                if (subjectSearch.text != '')
                                {
                                        filterGrid();
                                }
                        
                        }
                ]]>
        </mx:Script>

        <mx:RemoteObject id="archiveSvc"
                                         destination="ColdFusion"
                                         source="tilelistFilter.src.cfcs.crud"
                                         showBusyCursor="true"
                                         
fault="CursorManager.removeBusyCursor();Alert.show(event.fault.message)">

                <mx:method name="getDocs"
                                   result="archiveResult(event)"/>

        </mx:RemoteObject>

        <mx:HBox>

                <mx:VBox horizontalAlign="center">
                        <mx:Label text="Keyword Search:"/>
                        <mx:TextInput id="generalSearch"
                                                  
change="keywordChangeHandler(event)"/>
                </mx:VBox>

                <mx:VBox horizontalAlign="center">
                        <mx:Label text="Search By Title:"/>
                        <mx:TextInput id="titleSearch"
                                                  
change="titleChangeHandler(event)"/>
                </mx:VBox>

                <mx:VBox horizontalAlign="center">
                        <mx:Label text="Search By Subject:"/>
                        <mx:TextInput id="subjectSearch"
                                                  
change="subjectChangeHandler(event)"/>
                </mx:VBox>

        </mx:HBox>

        <mx:TileList width="800"
                                 height="100%"
                                 dataProvider="{archiveAr}"
                                 itemRenderer="renderers.archiveRenders"/>

</mx:Application>


Reply via email to