1 Reply Latest reply on Jul 29, 2008 7:51 AM by Newsgroup_User

    Mystery with ADG and XML

    EdwinvD
      Hi,

      I am probably overlooking something obvious but have been spending already too much time on the following problem.

      Based on a HTTP-request XML-data are send from a PHP-page to Flex. Structure of the XML is as follows:
      <items>
      <item>
      <GuestBookItemContributor> some text</GuestBookItemContributor>
      <GuestBookItemDate>2006-05-26</GuestBookItemDate>
      <GuestBookItemMessage> some text</GuestBookItemMessage>
      </item>
      etc, etc
      </items>

      This data is put into a variable called GuestBookData. The content is displayed without any problem within a TexArea. When I however try to display the XML in an AdvancedDataGrid it does not show at all. The ADG looks as follows:
      <mx:AdvancedDataGrid x="1" y="41" id="ADG_GuestBookItems" designViewDataType="tree" dataProvider="{new HierarchicalData(GuestBookData)}" width="100%" height="295">
      <mx:columns>
      <mx:AdvancedDataGridColumn headerText="Bijdrage van:" dataField="GuestBookItemContributor"/>
      <mx:AdvancedDataGridColumn headerText="Datum" dataField="GuestBookItemDate"/>
      <mx:AdvancedDataGridColumn headerText="Bijdrage van:" dataField="GuestBookItemContributor"/>
      <mx:AdvancedDataGridColumn headerText="Tekst bericht" dataField="GuestBookItemMessage"/>
      </mx:columns>
      </mx:AdvancedDataGrid>

      To add to my puzzle, if I put the exact same XML in a <mx:XML> everything works fine and all XML-data is displayed.

      Thanks for your help,

      Edwin
        • 1. Re: Mystery with ADG and XML
          Level 7

          "EdwinvD" <webforumsuser@macromedia.com> wrote in message
          news:g6n4mo$nu7$1@forums.macromedia.com...
          > Hi,
          >
          > I am probably overlooking something obvious but have been spending already
          > too
          > much time on the following problem.
          >
          > Based on a HTTP-request XML-data are send from a PHP-page to Flex.
          > Structure
          > of the XML is as follows:
          > <items>
          > <item>
          > <GuestBookItemContributor> some text</GuestBookItemContributor>
          > <GuestBookItemDate>2006-05-26</GuestBookItemDate>
          > <GuestBookItemMessage> some text</GuestBookItemMessage>
          > </item>
          > etc, etc
          > </items>
          >
          > This data is put into a variable called GuestBookData. The content is
          > displayed without any problem within a TexArea. When I however try to
          > display
          > the XML in an AdvancedDataGrid it does not show at all. The ADG looks as
          > follows:
          > <mx:AdvancedDataGrid x="1" y="41" id="ADG_GuestBookItems"
          > designViewDataType="tree" dataProvider="{new
          > HierarchicalData(GuestBookData)}"
          > width="100%" height="295">

          You need to tell the HirarchicalData object what the children field is.

          HTH;

          Amy