OK - I'm going about this problem from another angle.  But I'm still scratching 
my head.  Same scenario - 2 components within the app.  I have a tab bar in the 
main app that users click to change to the different component views.  

I came up with the idea to have the tab bar (who calls the different 
components) trigger an event - and the component with the datagrid is set up to 
listen for that event.   But that doesn't seem to work either.  While the main 
app is successfully dispatching my event every time I click the tab bar 
options, the datagrid component is not triggering its "listening" function.  

Below is the code.   Any ideas why the component won't trigger the 
refreshUserData when I am clicking the tab bar?

MAIN APPLICATION: 
        <mx:Script>
                <![CDATA[
                        private function triggerEvent(event:Event):void {
                                var event:Event = new Event("clickAdminUser");
                        dispatchEvent(event);
                        }
                ]]>
        </mx:Script>

<mx:TabBar id="tbAdmin" direction="vertical" dataProvider="{viewStack}" 
width="10%" paddingLeft="10" styleName="AdminTabBar" 
itemClick="triggerEvent(event)" />

<mx:ViewStack id="viewStack" width="87%" height="99%" >
        <components:AdminUser id="cUser" label="Users" width="100%" 
height="100%" />

        <components:AdminUserInput id="cUserInput" label="User Input" 
width="100%" height="100%" />
</mx:ViewStack>

--------------------------------------------------------------
COMPONENT ADMINUSER
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"; horizontalCenter="true" 
height="100%" width="100%" horizontalScrollPolicy="off"
        verticalScrollPolicy="off" creationComplete="init()" 
xmlns:components="components.*" >

<mx:Script>
                <![CDATA[

                        public function init():void {
                                
                                
addEventListener("clickAdminUser",refreshUserData);
                                refreshUserData();
                        }

                        private function refreshUserData():void {
                                roUser.getUsers();      
                                
                        }
</mx:Script>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319970
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to