2 Replies Latest reply on Jul 31, 2009 9:49 AM by Flex harUI

    Button Event

    hclselvs Level 1

      Hi,

       

      I have a search button on top of my Datagrid in the application, I have written an event for the search button to retrieve the data from the database and need to populate it in a datagrid. The values will be as ArrayCollection and I provided the same to the dataprovider. I am facing a problem like, when I click a search button, the values are not populated in datagrid, but if I click again, it is getting populated.

       

      I can see the datas from database in a console, when I click the search button for the first time. The only thing is that, it is getting populated only when we click the search button again.

       

      Any solution for this issue?

       

      Thanks in Advance,

       

      Regards,

      Srinivasan S

        • 1. Re: Button Event
          Gregory Lafrance Level 6

          1) Is the ArrayCollection bindable (  [Bindable]  )?

           

          2) After the data comes in, call myAC.refresh().

           

          If this post answers your question or helps, please mark it as such.

          • 2. Re: Button Event
            Flex harUI Adobe Employee

            I'm sure there's a solution.  You'll probably have to do some debugging.  Normally, you use WebService, RemoteObject or HTTPService to get data.  The resultHandler updates an ArrayCollection.  The ArrayCollection dispatches collectionChange events.  The DataGrid is assigned the ArrayCollection or is already watching the ArrayCollection and its collectionChangeHandler method is called and later, updateDisplayList generates itemRenderer instances.

             

            Use the debugger to find out where that sequence is broken.

             

            Alex Harui

            Flex SDK Developer

            Adobe Systems Inc.

            Blog: http://blogs.adobe.com/aharui