4 Replies Latest reply on Nov 20, 2009 4:33 PM by =VA=FyreHeart

    OLAPDataGrid and HTTPService


      I'm having a problem getting server data for my OLAPDataGrid. (I actually have this problem with all my DataGrids.)


      I'm using a PHP file to pass the data back as XML and convert it to an ArrayCollection object. Some of the queries have multiple JOINs or large result sets, and whenever there's a delay, I get an error in my DataGrid. The OLAP datagrid seems particularly sensitive to this. I've never gotten server data to work, but if I code the very same data inline the cube works fine.


      I'm getting around it in the DataGrid control by using the "render" event instead of "creationComplete," but OLAPDataGrid doesn't seem to support "render."


      How can I get the OLAPDataGrid to wait until the ArrayCollection is populated before running its query?

        • 1. Re: OLAPDataGrid and HTTPService
          =VA=FyreHeart Level 2

          The error is:


              at mx.olap::OLAPCube/executeQuery()[C:\work\flex\dmv_automation\projects\datavisualisation\s rc\mx\olap\OLAPCube.as:881]
              at flash.utils::Timer/_timerDispatch()
              at flash.utils::Timer/tick()

          • 2. Re: OLAPDataGrid and HTTPService
            Gregory Lafrance Level 6

            Run the query from the result handler function, that way you know the data is back and stuffed in the AC.


            Flex is asynchronous, so you can't assume the data is there, and you often must to things in the result handler.


            Of course, the better way to do it is dispatch a custom event when the data is ready, have the OLAP component listen for the event, and then it fires its query.


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

            1 person found this helpful
            • 3. Re: OLAPDataGrid and HTTPService
              =VA=FyreHeart Level 2

              Thanks for the suggestions.


              I have run functions from the ResultEvent handler for the AdvancedDataGrid, but how do I pass the CubeEvent to the query handler if I run the cube query that way? Or do I need to?


              I'll play with your idea of setting up an event listener on the cube, too. That actually sounds like a "one size fits all" solution, albeit a more complicated one.



              • 4. Re: OLAPDataGrid and HTTPService
                =VA=FyreHeart Level 2

                Hate to say this, but I resolved the async problem and I'm still getting the above error. It's like it can't find a component. I upgraded to Flex SDK 3.4 and the latest Data Visualization components, but no change.


                Does anyone else have ideas?


                Thanks in advance.