3 Replies Latest reply on Dec 21, 2007 1:54 PM by Garyl Woolworth

    Combining Apps

    GeorgeWS Level 1
      I have a Navigation Application It has a linkbar with 7 links that everyone in the company can see. Some people have access to a bunch of other application. To many to fit across the screen so I thought I will have a combobox. This is all fine and working great. How do I include the navigation in each application? Or have like a frame where the Navigation App is at the top and a apps appear below? Im thinking viewstack? Really my only problem is that my combobox gets hidden behind the other part of my frame.

      Thanks
      George
        • 1. Re: Combining Apps
          Zolotoj Level 3
          I am using treeview on the left side and a larger area on the right to run an app in. I am using modules as apps. I am loading these modules from a click on a node tree.
          • 2. Re: Combining Apps
            Gregory Lafrance Level 6
            How about an ApplicationControlBar:

            ------------------------------- Test.mxml -------------------------------
            <?xml version="1.0"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns:comp="components.*">
            <mx:Script>
            <![CDATA[
            private function selectPortal(event:Event):void {
            if(cmbx.selectedItem.data == "home"){
            portals.selectedChild = home;
            }
            if(cmbx.selectedItem.data == "hr_portal"){
            portals.selectedChild = hr_portal;
            }
            if(cmbx.selectedItem.data == "is_portal"){
            portals.selectedChild = is_portal;
            }
            if(cmbx.selectedItem.data == "pay_portal"){
            portals.selectedChild = pay_portal;
            }
            }
            ]]>
            </mx:Script>

            <mx:ApplicationControlBar width="100%">
            <mx:Label text="Select an intranet portal: " fontSize="12"/>
            <mx:ComboBox id="cmbx" change="selectPortal(event)">
            <mx:Object label="XYZ Intranet Home Page" data="home"/>
            <mx:Object label="Human Resources Portal" data="hr_portal"/>
            <mx:Object label="Information Services Portal" data="is_portal"/>
            <mx:Object label="Payroll Portal" data="pay_portal"/>
            </mx:ComboBox>
            </mx:ApplicationControlBar>
            <mx:ViewStack id="portals" width="100%" height="100%">
            <mx:Panel width="100%" height="100%" horizontalAlign="center"
            backgroundColor="#ccffcc" id="home">
            <mx:Text text="Welcome to the XYZ Corporate Intanet" fontSize="20"
            color="blue"/>
            </mx:Panel>
            <comp:HumanResources id="hr_portal"/>
            <comp:InformationServices id="is_portal"/>
            <comp:Payroll id="pay_portal"/>
            </mx:ViewStack>
            </mx:Application>
            ---------------------------------------------------------------------------
            components\HumanResources.mxml
            <?xml version="1.0" encoding="utf-8"?>
            <mx:Panel xmlns="*" xmlns:mx=" http://www.adobe.com/2006/mxml"
            width="100%" height="100%" horizontalAlign="center" backgroundColor="red">
            <mx:Text text="Human Resources Portal" fontSize="20"
            color="blue"/>
            </mx:Panel>
            --------------------------------------------------------------------
            ---------------------- InformationServices.mxml --------------
            <?xml version="1.0" encoding="utf-8"?>
            <mx:Panel xmlns="*" xmlns:mx=" http://www.adobe.com/2006/mxml"
            width="100%" height="100%" horizontalAlign="center" backgroundColor="purple">
            <mx:Text text="Information Services Portal" fontSize="20"
            color="blue"/>
            </mx:Panel>
            ------------------------------------------------------------------
            --------------------------- Payroll.mxml --------------------
            <?xml version="1.0" encoding="utf-8"?>
            <mx:Panel xmlns="*" xmlns:mx=" http://www.adobe.com/2006/mxml"
            width="100%" height="100%" horizontalAlign="center" backgroundColor="gray">
            <mx:Text text="Payroll Portal" fontSize="20"
            color="blue"/>
            </mx:Panel>

            • 3. Re: Combining Apps
              Garyl Woolworth
              You could simplify the selectPortal function to be more dynamic by doing it this way.

              private function selectPortal(event:MouseEvent):void {
              portals.selectedChild = portals[event.currentTarget.selectedItem.data];
              }

              This allows you to use any component that supports the selectedItem (Datagrid, Tree, List, etc..) as well as allows you to update the dataProvider and not have to change the selectPortal function.