1 Reply Latest reply on Nov 27, 2006 10:36 AM by ntsiii

    Can we Refresh the pages when navigating the pages with ApplicationControlBar

    DataGrid+XML Level 1
      Hi,

      When i am navigating the pages from one page to another page can i refresh the data.


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*"
      layout="absolute" minWidth="990" minHeight="550" pageTitle="Motorola"
      creationComplete="initApp()">

      <mx:Script>
      <![CDATA[
      import mx.collections.IViewCursor;
      import mx.collections.ArrayCollection;
      import asclasses.MImage;
      import asclasses.ButtonBarButtonSkin;
      import mx.rpc.events.ResultEvent;
      import mx.controls.Alert;

      [Bindable]
      private var catalog:ArrayCollection;

      private function initApp():void
      {
      imageService.send();
      Alert.show("creation complete");
      }

      private function imageServiceResultHandler(event:ResultEvent):void
      {
      //HTTPService returns an ArrayCollection for nested arrays
      var images:ArrayCollection = event.result.catalog.image;
      var temp:ArrayCollection = new ArrayCollection();
      var cursor:IViewCursor = images.createCursor();
      while (!cursor.afterLast)
      {
      var image:MImage = new MImage();
      image.fill(cursor.current);
      temp.addItem(image);
      cursor.moveNext();
      }
      catalog = temp;
      }

      ]]>
      </mx:Script>

      <mx:Style source="main.css"/>
      <mx:Style source="blue.css"/>

      <mx:HTTPService id="imageService" url="datamodel/catalog.xml"
      result="imageServiceResultHandler(event)"/>

      <mx:VBox width="990" paddingLeft="0" paddingRight="0" horizontalCenter="0" top="12">
      <mx:ApplicationControlBar id="acb" width="88.5%" styleName="storeControlBar">
      <!--mx:Image source="{acb.getStyle('storeLogo')}" /-->
      <mx:Image source="@Embed('/assets/logo_blue.png')"/>
      <mx:ToggleButtonBar
      height="100%"
      dataProvider="{storeViews}"
      styleName="storeButtonBar"/>
      <mx:Spacer width="100%"/>
      <mx:Image source="@Embed('/assets/mothblues.png')" />
      </mx:ApplicationControlBar>
      <mx:ViewStack id="storeViews" width="100%" height="550" creationPolicy="all">
      <HomeView id="homeView" label="Home"
      showEffect="WipeDown" hideEffect="WipeUp"
      />
      <ImagesView id="pView" label="Images" catalog="{catalog}"
      showEffect="WipeDown" hideEffect="WipeUp"
      />
      <ContactView id="supportView" label="Contacts"
      showEffect="WipeDown" hideEffect="WipeUp"
      />
      <Synchronize id="sync" label="Synchronization"
      showEffect="WipeDown" hideEffect="WipeUp"
      />
      </mx:ViewStack>
      </mx:VBox>
      </mx:Application>

      Regards
      Rajasekhar