7 Replies Latest reply on May 17, 2006 5:50 PM by lw1001

    Noob Beta 3 problem with dataprovider

    lw1001
      i have a component that loads data into a grid with an HTTPService request. It works fine if i set it up as a separate application with creationComplete="response.send()" defined in the application. The data grid is populated as expected using:
      <DataGrid id = "assignments" dataProvider = "{response.lastResult.results.tasks.task}" >
      <DataGridColumn ....etc.>
      </DataGrid>

      However, if i create the same logic as a component (with the outermost container being a canvas) and place the same creationComplete="response.call()" in the canvas, the display is never updated when the component is loaded into another application. I don't know if it matters or not but the component is loaded into the application on a state change. The HTTPService call gets made but the UI never updates. The only thing I can think of is that its a timing issue. Any ideas? This is getting pretty frustrating. :-(
        • 1. Re: Noob Beta 3 problem with dataprovider
          Level 7
          lw1001" <webforumsuser@macromedia.com> wrote in message
          news:e48kn7$e9l$1@forums.macromedia.com...
          >i have a component that loads data into a grid with an HTTPService request.
          >It
          > works fine if i set it up as a separate application with
          > creationComplete="response.send()" defined in the application. The data
          > grid
          > is populated as expected using:
          [snip]

          > However, if i create the same logic as a component (with the outermost
          > container being a canvas) and place the same
          > creationComplete="response.call()"
          > in the canvas, the display is never updated when the component is loaded
          > into
          > another application. I don't know if it matters or not but the component
          > is
          > loaded into the application on a state change. The HTTPService call gets
          > made
          > but the UI never updates. The only thing I can think of is that its a
          > timing
          > issue. Any ideas? This is getting pretty frustrating. :-(

          Are you getting a response? Is the result handler getting called?

          --
          Manish Jethani
          Developer, Flex Framework
          Adobe Systems Inc.


          • 2. Re: Noob Beta 3 problem with dataprovider
            lw1001 Level 1
            The server output is indicating that it received the request. I'm assuming that it returned a response because testing both in a different flex configuration and looking directly at the http response outside of flex show valid xml coming back.

            How do i tell if the response handler got called?
            • 3. Re: Noob Beta 3 problem with dataprovider
              ntsiii Level 3
              Define a result handler function and assign it to the "result" event of http service. Put a break point in the handler function, and run debug. If the call is returning, your will hit the breakpoint.

              You can also now examine the structure of the "lastResult" object to make sure you are referencing it correctly in your DataGrid.

              Tracy
              • 4. Re: Noob Beta 3 problem with dataprovider
                lw1001 Level 1
                The canvas in the component is rendered but the creationComplete event never fires.

                This is the component. I added the update_grid function so i could put a breakpoint in it, rather than calling response.send() directly . it never gets hit:

                <?xml version="1.0" encoding="utf-8"?>
                <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="100%" height="100%" horizontalCenter="0" verticalCenter="0" creationComplete="update_grid()" >

                <mx:HTTPService id="response" url=" http://localhost:3000/dashboard/index" useProxy="false" />
                <mx:HBox width="100%" height="100%" horizontalCenter="0" verticalCenter="0">
                <mx:VBox height="100%" width="100%">
                <mx:Label text="Current Assignments"/>
                <mx ataGrid id="assignments"
                dataProvider="{response.lastResult.response.tasks.task}"
                verticalGridLines="false"
                width="100%">
                <mx:columns>
                <mx ataGridColumn headerText="Task" dataField="name"/>
                <mx ataGridColumn headerText="Description" dataField="description"/>
                <mx ataGridColumn headerText="Duration" dataField="duration"/>
                <mx ataGridColumn headerText="Due date" dataField="scheduled-end-date" />
                <mx ataGridColumn headerText="Project" dataField="project"/>
                </mx:columns>
                </mx ataGrid>
                </mx:VBox>
                </mx:HBox>
                <mx:Script>
                <![CDATA[
                public function update_grid():void{
                response.send();
                }
                ]]>
                </mx:Script>
                </mx:Canvas>
                • 5. Re: Noob Beta 3 problem with dataprovider
                  ntsiii Level 3
                  Have you tried any other events? Reviewed the event documentation?

                  Tracy
                  • 6. Re: Noob Beta 3 problem with dataprovider
                    ntsiii Level 3
                    I found this in the Migration guide. It says use initialize, instead of creationComplete.

                    Component startup
                    The ordering of events during a component’s
                    has been renamed to preinitialize.
                    The initialize event now occurs after
                    instead of calling an event handler
                    initialize event handler to perform
                    The childrenCreated event has been
                    A new event, applicationComplete,
                    during an application’s startup.
                    • 7. Re: Noob Beta 3 problem with dataprovider
                      lw1001 Level 1
                      i tried initialize and preinitialize. neither works. the applicationComplete event is not defined for canvas, and unless I'm mistaken you can't or shouldn't have more than one application element within a project.

                      I'm thinking this is a bug. it would be nice to know somebody was working on it.