4 Replies Latest reply on Aug 23, 2013 5:29 AM by Nikitul

    Create CFC wizard questions and Flash Builder connection to same

    umms_gary

      Hi:

       

      I tried to connect up in Flash Builder 4 Beta to a Database Service that I created with the Create CFC wizard in ColdFusion Builder and I can't seem to make it work.  The getAll function generated in the Gateway.cfc file doesn't seem to do things similar to the demo files in the getting started videos, as it seems to do a lot of extra processing to reconstruct the result set from a query object into a collection before handing it back.  As a result of this, Flash Builder does not seem to be able to populate a grid based on the getAllItem.

       

      I'm a real newbie to Flash Builder, so it could easily be something simple that I've just done horribly wrong, but I've been stuck on trying to create and populate a simple grid from a CFC link to one of my legacy tables in SQL Server.  I get the column headings correctly, and apparently the right number of rows, but all the rows managed to populate only a 0 as the value of any Numeric field and blanks for all the text fields.

       

      Another side issue is that the generated loop that populates the collection that is eventually returned from the getAll function crashes with a CF error when a field that was typed as an integer had null values in the underlying table.  Could it be made more robust to handle NULL items more gracefully?

       

      Why not simply return the query object as the result variable here?

      Why do you need to set up the whole "load value objects" loop?

       

      Thanks,   Gary

        • 1. Re: Create CFC wizard questions and Flash Builder connection to same
          Balaji Sridhar Level 2

          Hi,

           

          Thanks for your feedback

           

          This integration between CFBuilder and Flash Builder has undergone a lot of development since the BETA release of Flash Builder.

          Also there are few changes which have gone into the Adobe CFC Generator.

           

          Can you please use the latest Adobe CFC generator from

          http://blogs.adobe.com/cfbuilder/2009/07/orm_cfc_generator_1.html

           

          Also there is a latest pre-release version of Flash Builder which has got released post BETA .

          So can you subscribe by sending a mail to rkrishna@adobe.com.

           

          Can you verify the same workflow using these latest builds and let us know your thoughts?

           

          Thanks,

          Balaji

          http://balajisridhar.wordpress.com/

          • 2. Re: Create CFC wizard questions and Flash Builder connection to same
            umms_gary Level 1

            Thanks for the suggestion.

             

            Since posting this question, I discovered that I could build a much simpler function based on a simple CF query and that would be enough to make the Flash Builder work correctly.  The function returns the query scope as a generic object and I get offered the chance to update the field types, etc.  Fields which contain nulls are introspected as Objects rather than integer, etc.  Much nicer to work with from my perspective, and clearly a lot quicker to execute since it has no need to loop over the query to recast the result set as a 0 based indexed array.

             

            Although I have installed CF9 beta Developer Edition on my desktop, I was trying to avoid using the ORM stuff with my testing of connections to legacy applications, mostly because our production CF servers obviously don't yet support using these CF9 enhancements.

             

            I don't know if it makes any difference at all, but the generator code I was using was from the Create CFC path, not the Create ORM CFC, but that leads me to ask if there is any advantage to using one flavor over the other in terms of development or performance.  The blog posting seems to talk about ORM version having been enhanced, and did not suggest that also applies to the non-ORM services.

             

            I should probably have tested your suggestion before responding, and I will test as you suggested, but right now I still don't get why the generator's multi line return query result sets are looped over to rebuild them into an Array. Is this related to some sort of need to convert between the 0 based MX array vs 1 based CF query objects?

             

            I'll come back here to let you know how it goes with the newer version.

            • 3. Re: Create CFC wizard questions and Flash Builder connection to same
              Evelin Varghese Level 2

              Hi,

              While generating the CFC did you choose option ColdFusion 8 compatible?

              The values may be coming as null for you because there may be no getters and setters available in the table CFC.

              Getters and setters are generated if you choose ColdFusion8 compatible check box while generating the CFC.

              Other wise you can choose to use implicit getters and setters in case of CF9.

              For implicit getters setters to be available while flash remoting you need to set use-implicit-accessors as true in service-config.xml available at webroot\WEB-INF\flex\service-config.xml

               

              Thanks

              Evelin

              • 4. Re: Create CFC wizard questions and Flash Builder connection to same
                Nikitul

                Hi,

                Please extend the explanation about "setting use-implicit-accessors as true in service-config.xml"

                I'd  like to get the bean cfc with  implicit setters and getters (accessors="true") and without CFC Generator generated ones.

                Is that possible?
                I tried different ways without succes.

                First I opened service-config.xml and I didn't find any use-implicit-accessors tag (set to true), so I made one under use-accessors tag.

                Also I tried to set use-accessors tag to false

                Nothing worked.

                 

                 

                Thanks

                Stef