4 Replies Latest reply on Nov 1, 2008 11:48 PM by Gregory Lafrance

    Problem filling DataGrid with XML - Object or ArrayCollection?

    rjoshicool Level 2
      Hi,

      I am trying to fill a datagrid with an XML file, rendered from a PHP
      script.
      The problem is that - first time there is only one entry in the XML
      file, so when I receive the data using event.result.root.child, I get
      an Object. But second time, when there are two entries in the XML
      file, the return type becomes an ArrayCollection of "child" type
      objects.
      This causes a problem when setting dataprovider of a DataGrid....
      So is there a way I can know what is the return type from the XML
      file, i.e., whether it is an Object or an ArrayCollection, so that I
      can set the dataprovider accordingly?