4 Replies Latest reply on Jan 16, 2008 10:42 AM by ChiefRocka00

    Problems with XML List

    Tigomark Level 1
      Hey all,

      I am having a problem getting information to display on a Tile List that I have created.

      Code:

      <mx:HTTPService id="tempXML" url="https://{customer.text}.mysite.net/interface.php?action=showopen&amp;operation=showa ssets&amp;format=xml&amp;opstatus=crit&amp;username={username.text}&amp;password={password .text}" />

      <mx:Script>
      <![CDATA[
      import mx.collections.*;
      [Bindable]
      public var TileList1dp:ArrayCollection;

      private function initData():void {
      TileList1dp = new ArrayCollection(tempXML.lastResult.asset.fleet);
      }
      ]]>
      </mx:Script>

      <mx:TileList dataProvider="{TileList1dp}"
      width="344" backgroundColor="#000000" color="#ff0000" fontSize="27" borderColor="#000000" columnWidth="300" rowHeight="50" themeColor="#808080" fontWeight="bold" allowMultipleSelection="true" id="TileList1" height="0" y="202" x="178"/>

      I can look through fire bug and see that I am seeing the XML being recieved but I am not seeing the data being displayed in the app.

      I am trying to find an example of the result handler that will get the
      data to the TileList.

      I know that I am probably noobing this problem but I am still new and unsure of how to recieve.
        • 1. Re: Problems with XML List
          ChiefRocka00 Level 1
          use an itemRenderer in your TileList
          • 2. Problems with XML List
            Tigomark Level 1
            What would you render in the item renderer. This is the only file in use. itemRender seems to attach a mxml or as file and doesn't give view data.
            • 3. Re: Problems with XML List
              Tigomark Level 1
              Hey all,

              I am having a problem getting information to display on a Tile List that I have created.

              Code:

              <mx:HTTPService id="tempXML" url="https://{customer.text}.mysite.net/interface.php?action=showopen&amp;operation=showa ssets&amp;format=xml&amp;opstatus=crit&amp;username={username.text}&amp;password={password .text}" />

              <mx:Script>
              <![CDATA[
              import mx.collections.*;
              [Bindable]
              public var TileList1dp:ArrayCollection;

              private function initData():void {
              TileList1dp = new ArrayCollection(tempXML.lastResult.asset.fleet);
              }
              ]]>
              </mx:Script>

              <mx:TileList dataProvider="{TileList1dp}"
              width="344" backgroundColor="#000000" color="#ff0000" fontSize="27" borderColor="#000000" columnWidth="300" rowHeight="50" themeColor="#808080" fontWeight="bold" allowMultipleSelection="true" id="TileList1" height="0" y="202" x="178"/>

              I can look through fire bug and see that I am seeing the XML being recieved but I am not seeing the data being displayed in the app.

              I am trying to find an example of the result handler that will get the
              data to the TileList.

              I know that I am probably noobing this problem but I am still new and unsure of how to recieve.
              • 4. Re: Problems with XML List
                ChiefRocka00 Level 1
                If you have an itemRenderer in you TileList you can do whatever you want. I assume since you are returning an array collection there are multiple parts of the data you want to display in the tile? Here is a snippet of what the TileList would look like:

                <mx:TileList dataProvider="{myData}" height="400" width="800" itemRenderer="customTileRenderer"/>

                Then you create a customTileRenderer.mxml file which acts as the item renderer. Here is what a simple item renderer might look like:

                <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml">

                <mx:Script>
                <![CDATA[

                override public function set data(value:Object):void {
                if ( value != null ) {
                super.data = value;
                }
                }

                ]]>
                </mx:Script>

                <mx:VBox width="100%" id="theBox" verticalGap="0" cacheAsBitmap="true">
                <mx:Label id="lblOwnerName" text="{data.Owner}" />
                <mx:Label id="lblAddress" text="{data.Address}" />
                <mx:Label id="lblCity" text="{data.City}" />
                </mx:VBox>

                </mx:Canvas>

                and the XML that was cast into the ArrayCollection would look something like this:

                <Customers>
                <PeronalInfo>
                <Owner>Bob Jones</Owner>
                <Address>1 Main St</Address>
                <City>Jefferson</City>
                </PeronalInfo>
                <PeronalInfo>
                <Owner>Mary Jane</Owner>
                <Address>14 Elm St</Address>
                <City>Williamstown</City>
                </PeronalInfo>
                <PeronalInfo>
                <Owner>Bill Murphy</Owner>
                <Address>18 Great Plain Ave</Address>
                <City>W Roxbury</City>
                </PeronalInfo>
                </Customers>