6 Replies Latest reply on Nov 3, 2009 1:00 PM by sudhirm-rRcgag

    Refreshing PHP services data types

    Crt Gorup

      Hi,

       

      I am using PHP data services and it seems that refresh function doesn't work for auto generated data types. If I edit some function in PHP layer the changes are correctly reflected in Flash Builder, but if I edit (add some new variables to) PHP return class there is no way to refresh this in auto generated data type in  Flash Builder. I am doing something wrong?

       

      Regards, Crt

        • 1. Re: Refreshing PHP services data types
          Gaurav P(Adobe) Level 2

          We you using the FB generated code and trying to refresh after manually adding data properties, it will not work.

          Instead of refreshing use CRT(configure return type) on the function which returns the intended data type. This will update the data type.

           

          Thanks,

          - Gaurav

          • 2. Re: Refreshing PHP services data types
            pollymath

            I have a simlar issue : I have an AMF service that returns results successfully, however the object returned contains several objects one of which I want to use as the dataprovider. When I configure return type for the function call the wizard launches and can see the structure of the returned data but I can't select the the nested object ( as is the case in the WSDL example). I am left returning the outer most objects in my Object:

             

            returnObjectDialogue.png

            Am I missing something here?

             

            Richard

            • 3. Re: Refreshing PHP services data types
              sudhirm-rRcgag Adobe Employee

              Hi pollymath,

               

              You can proceed by following the steps given below.

               

              1. In your configure Return type wizard, you can give any name for the nodes in the retruned data.

              For example, you can set the node "data" to be of type "Data" and the subnode "tracks" to be of type "Tracks".

              2. After doing this, click on Finish.

              3. Now, the returntype of the function will be "Data", with a subnode called "Tracks" inside it.

              4. Now, if you want to assign "tracks"as the dataProvider to a component (say DataGrid), u can use the code given below.

               

              <mx:DataGrid id="dataGrid" dataProvider="{trackResult.lastResult.data.tracks}">
                      <mx:columns>
                          <mx:DataGridColumn headerText="cdnumber" dataField="cdnumber"/>
                          <mx:DataGridColumn headerText="primaryid" dataField="primaryid"/>
                          <mx:DataGridColumn headerText="composer" dataField="composer"/>
                         
                      </mx:columns>
                  </mx:DataGrid>

              Observe that i have set the dataProvider to "{trackResult.lastResult.data.tracks}"

               

              Hope this helps.

               

              Thanks,

              Sudhir

              • 4. Re: Refreshing PHP services data types
                SunilAdobe Adobe Employee

                Richard,

                 

                If you think choosing a subfiled of a complex type as dataprovider in the bind to data dialog solves your problem, you can vote for the bug at http://bugs.adobe.com/jira/browse/FB-21662 and add any specific requirment of yours as a comment.

                 

                Thanks

                -Sunil

                • 5. Re: Refreshing PHP services data types
                  pollymath Level 1
                  <mx:DataGrid id="dataGrid" dataProvider="{trackResult.lastResult.data.tracks}">

                  Hmm I think that should be <mx:DataGrid id="dataGrid" dataProvider="{trackResult.lastResult.source.data.tracks}"> at least that is what works for me. Your EG  threw an error.

                   

                  I think that what is confusing is that you have to bind against the whole object returned from the CallResponder. Setting the return type in the Data/Services pannel to in my case Tracks[] maps the columns nicely to the Tracks children I assumed that in setting the returnType of trackResult you would be able to bind to that. I think I will not be alone in getting caught by this.

                  • 6. Re: Refreshing PHP services data types
                    sudhirm-rRcgag Adobe Employee

                    You will have to change the dataprovider property based on your root node. Looking at the screenshot, i thought the root node was "data" and hence i coded accordingly in the example.

                    As Sunil has already mentioned, choosing a subfiled of a complex type as dataprovider, while binding component to data will save us from manually editing the dataprovider. Enhancement request http://bugs.adobe.com/jira/browse/FB-21662 has been filed for the same and will be looked into.

                    Thanks for your feedback

                     

                    -Sudhir