4 Replies Latest reply on Dec 19, 2007 10:08 AM by

    some quick feedback on Flex 3

      This is my second day with Flex 3 (a first-time user of Flex), and this is my second day of trying out Flex 3, so, bear with me if I don't seem to know what I'm talking about.

      Because I'm particularyly interested in data interaction I picked the "Working with Data in Flex Builder 3" section, concept explanation and samples are good, but in essence most of the samples' raw data manually entered / hard coded data such as [{label:"AL", data:"Montgomery"}. I said it's good for it can easily get a point across quickly, however, it leaves a lot to be desired in the real world, that is, in most cases imho, I would run a query or two get data from a database or two, yes, I understand one can do so with web service, but what if no such web service exists for such datasets, you have to create a web service first? don't think it's convoluted? Why not provide direct database connectivity? Yes, I understand cfc can be called as a web service. Once again, I think it would be nice more options are available to access underlying data (after all, Flex is to Present Data in Appealing and Easy to Grasp fashion.

        • 1. Re: some quick feedback on Flex 3
          Zolotoj Level 3
          Flex is just a client side (UI interface) development tool. RIA is the word. You can easily pull your data from a database into your Flex application. I am using ASP for that. This product has a way of connecting to the Server (to an ASP page for example) via HTTPService (AJAX fashion). Form an ASP you can access your data ro call another component to do the job. All an ASP has to do is to return an XML in the known to the Flex application format. Look for HTTPService examples.
          1 person found this helpful
          • 2. Re: some quick feedback on Flex 3
            Thanks. I'm getting some nasty errors when making HTTPService call,
            "[RPC Fault faultString="Error #1090: XML parser failure: element is malformed...." for the useProxy attribute, I've flip floped 'false' and 'true', neither helped. I've also turned off firewalls. Any idea?
            • 3. Re: some quick feedback on Flex 3
              dave cragg Level 2
              It looks like bad XML is being returned. This will happen, for example, if you are using php on the server side and the script encounters a parsing error. It will return the error in the data stream in it's own format (usually an html snippet), and it will throw Flex's XML parser.

              If you have the resultFormat of the HTTPService set to e4x, try setting it to "text" temporarily, and use the debugger (or trace) to check the data returned with the service result.

              One problem with Flex is that it's difficult to troubleshoot http errors. I usually use another utility side-by-side with Flex when testing server side processes.
              1 person found this helpful
              • 4. Re: some quick feedback on Flex 3
                Many thanks. That's a great debugging technique.
                Error: warning: unable to bind to property 'customer' on class 'String' (class is not an IEventDispatcher)

                Now it seems to me my Flex code may have some problem, which was essentially copied/pasted by Adobe Flex docs. It has the following 3 sections:
                a) app framework/config
                <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute" creationComplete="customerRequest.send()">
                b) HTTPService call
                <mx:HTTPService id="customerRequest" url="" useProxy="false" method="POST" resultFormat="text">
                <mx:request xmlns="">
                c) display query data
                <!-- display current datasets of "customers" -->
                <mx:DataGrid id="dgCustomerRequest" x="22" y="128" dataProvider="{customerRequest.lastResult.customers.customer}">
                <mx:DataGridColumn headerText="Customer ID" dataField="customerid"/>
                <mx:DataGridColumn headerText="Customer Name" dataField="companyname"/>
                <mx:TextInput x="22" y="292" id="selectedCusCity" text="{dgCustomerRequest.selectedItem.city}"/>

                Did I miss the import mx.rpc.http.HTTPService part with CDATA?
                I thought Flex would automatically take care of it if one uses HTTPService

                Sample data:

                <customerid>ABCD </customerid>

                <companyname>Alfreds Futterkiste</companyname>