2 Replies Latest reply on Apr 21, 2009 1:19 PM by m_hartnett

    XML Datagrid Refresh after search

    Marlene

      I have a data grid that is populated from an HTTPService call. The grid initially populates and then I want the user to be able to click on the button search for food merchant and have the datagrid refresh with only the food merchants. I thought I understood I needed to use an arrayCollection but I am getting an Error #1034: Type Coercion failed: cannot convert XMLList@187b57e9 to mx.collections.XMLListCollection. I have tried using both an xmllist and xmllistcollection. Any help is appreciated.

        • 1. Re: XML Datagrid Refresh after search
          Michael Borbor Level 4

          You could use XMLListCollection as well seems like you're trying to 

          apply or cast your result to an AC

           

          Sincerely,

           

          Michael

           

          El 21/04/2009, a las 14:38, Marlene <forums@adobe.com> escribió:

           

          >

          I have a data grid that is populated from an HTTPService call. The 

          grid initially populates and then I want the user to be able to 

          click on the button search for food merchant and have the datagrid 

          refresh with only the food merchants. I thought I understood I 

          needed to use an arrayCollection but I am getting an Error #1034: 

          Type Coercion failed: cannot convert XMLList@187b57e9 to 

          mx.collections.XMLListCollection. I have tried using both an xmllist 

          and xmllistcollection. Any help is appreciated.

          >

          • 2. Re: XML Datagrid Refresh after search
            m_hartnett Level 3

            You don't need to use an ArrayCollection.

             

            The rules are if the dgProvider is an Array it is automatically converted into an AC.

            If the dgP is an XML object it is converted into an XMLListCollection with one item.

            if the dgP is an XmlList it is converted into an XMLListCollection.

            You can use any of these as  the dataprovider including any object the implements IList or ICollectionView.

             

            If your initial population is successful it sounds like the result handler from the search may be doing something with the data.  Is the result handler for the search and the initial population the same method.  Is the result from the query a null or empty result?

             

            Unfortunately attachments are not showing up today so we cannot see your code.