4 Replies Latest reply on Jan 15, 2008 3:04 PM by Tigomark

    Problems with XML List

    Tigomark
      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
          soup_pot Level 1
          Might be a long shot but have you tried putting your parameters into a mx:request tag instead of masking them with &amp;? E.g.

          <mx:HTTPService id="tempXML" url="https://{customer.text}.mysite.net/interface.php">
          <mx:request>
          <action>showopen</action>
          <operation>showassets</operation>
          <format>xml</format>
          etc...
          </mx:request>
          </mx:HTTPService>
          • 2. Re: Problems with XML List
            Tigomark Level 1
            Yep but thanks. I am getting the data that is not a problem. I can open firebug and see the server returning the data I can update the data and again the proper data returns. The tile list just won't show it.
            • 3. Re: Problems with XML List
              David_HOlm
              did you create an event driven response to process the xml?

              Actionscript version follows

              <mx:Script>
              <![CDATA[
              import mx.rpc.events.ResultEvent;
              [Bindable]
              public var xmlHolder:XML;

              boardService=new HTTPService();
              boardService.resultFormat="e4x";
              boardService.url="your url here"
              boardService.addEventListener(ResultEvent.RESULT,handleBoardData);
              boardService.send();
              public function handleBoardData(event:ResultEvent){
              var xmlHolder:XML=new XML(event.result);
              }
              ]]>
              </mx:Script>


              you might need to tweak a few things to get it to where you want it to be

              Cheers
              Dave
              • 4. Re: Problems with XML List
                Tigomark Level 1
                Thank you to Tracy, Paul Andrews, springframework, Peter Ent and all the others that were with me in spirit trying to figure this out. In case any one has
                this same problem I am posting the solution that fixed this and this
                part is closed.

                Thank you again.

                Mark

                Code:

                <mx:HTTPService id="tempXML" resultFormat="e4x"
                result="onResult(event)"
                url="https://{customer.text}.mysite.net/interface.php?action=showopen&amp;operat\
                ion=showassets&amp;format=xml&amp;opstatus=crit&amp;username={username.text}&amp\
                ;password={password.text}"
                />

                <mx:TileList dataProvider="{_xlcMyListData}" labelField="fleet"
                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"/>

                <mx:Script>
                <![CDATA[

                import mx.collections.XMLListCollection;

                [Bindable]
                private var _xlcMyListData:XMLListCollection;


                private function onResult(Event:ResultEvent):void {
                var xmlResult:XML = XML(Event.result);
                _xlcMyListData = new XMLListCollection(xmlResult..asset);
                }

                ]]>
                </mx:Script>