Talk:ColdFusion/Flex Connectivity
From Adobe Labs
After a little playing around, I got Ben Forta's sample 'Phones' application working perfectly. I used it as a model to start experimenting with Flex builder. I have a very simple application that contains only a datagrid. I'm trying to bind the results of a ColdFusion query (via a properly mapped CFC) to the datagrid. It appears that something is being returned by the CFC, but the grid contains only empty rows (one for each element that would have been returned by the query). When I click on one of the datagrid column headers to see what happens, I get the following message:
"Cannot determine comparator for SortField with name 'fieldname'."
The CFC returns data to a cfdump test page just fine. How does one go about using data returned by a CFC that uses the CFQUERY tag? I'm fairly certain that by using Ben's sample application as a model and returning the data to Flex as an array that I could get the datagrid to populate correctly, but this seems like an unneccessary step that would add coding overhead to the application. Both Flash and ColdFusion Flash forms can access query results through Flash remoting without alot of jumping through hoops. It seems that Flex would make it even easier and I'm probably just missing a small piece of the puzzle.
I'm not neccessarilly looking for the answer here, but if you could point me to the right location to find documentation on how to work with Flash remoting in Flex 2, I'd be most appreciative. All examples and documentation I've seen thus far demonstrate how to use Web Services, XML, and HTTP Services, but not query objects. Also, if there are any sample applications that use CFQUERY results in the Flex app, that would be very helpful as well.
You guys are doing some great stuff here. I can't wait until it's released.
Thank You, M. McConnell
Check the case of your grid column names. CFQUERY returns all of the columns in uppercase, and AS3 is case sensitive. (we are going to fix this for the next beta.
--nimer
_________
Brilliant! Worked like a charm. I changed the field names to all caps in the datagrid and in the class file and it worked first time out of the gate. Gonna have some fun, now.
Thank you for your help, M. McConnell
_________
I get the same error in an example I am building but I am returning the results to the Flex file as XML text results and not through a CFC. So I know for a fact that the case is the same in both cases. Even more troubling is that three of the four columns sort but only one generates that error
| Table of contents |
Viewing the Results of a CFC Call
Regarding using a CFC in your Flex Project, it gives the following example to view the results:
mx.controls.Alert.show(ObjectUtil.toString(event.result));
Note that this assumes you've imported mx.utils.*, so a better all purpose example would be:
mx.controls.Alert.show(mx.utils.ObjectUtil.toString(event.result));
Overall would love to see whole lot more examples of how to send data back and forth using Mystic and Flex 2. Eg, what class does a cfquery get converted to? I was hoping it would be transformed into an ArrayCollection, but binding an ArrayCollection to the event.result doesn't seem to jive...?
- Tariq Ahmed (DOPEJAM)
CF Returns component type in lowercase
I'm trying to get the automatic conversion between cf and .as components to occur with the updated ColdFusion/Flex Connectivity. It seems to work fine except that cf returns the component type in lowercase. If the components in cf and .as are defined in mixed case, I wind up with a mismatch on the ResultEvent.result.
Is there a way to make cf respect the case of the returned object?
--AnoPres 19:10, 2 Mar 2006 (PST)
Can't add ColdFusion Remoting Service Flex Project
After installing the Beta2 of FlexBuilder along with the updated Mystic files, I can't create a new Flex project that uses the ColdFusion Data Services. The path to the flex-enterprise-services.xml file is never recognized even though I've verified the location many times.
I have the plain cf install in place (not the one with the full jrun install) running through IIS. The port in flex-enterprise-services.xml has been updated to reflect my webserver setup.
Any ideas?
--AnoPres 19:16, 21 Mar 2006 (PST)
Crap. I found it just after I posted this. The dialog makes it seem like you are supposed to browse to the directory that contains the flex-enterprise-services.xml file. It really wants the path to the root. In my case it was C:\CFusionMX7\wwwroot, not C:\CFusionMX7\wwwroot\WEB-INF\flex\.
--AnoPres 19:24, 21 Mar 2006 (PST)
In case of multiserver config, it's C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\flex\
Jen Larkin mr_urc2
Non of the Sample apps have been updated to Beta 2.0 HUH?
Hello,
I can't get any of the sample apps running under beta 2.0 I have gone through the tutorials and I can't get them to work.
I get an error saying: Could not resolve <mx:Application> to a component implementation. Main.mxml
I get the same error with the HBox and VBox tag.
On the <SetProperty> tag you are "property = hieght" instead of "name=hieght"
You are going to confuse the hell out of people if you don't update the samples to work with the new Beta's.
Non of the Sample apps have been updated to Beta 2.0 HUH?
Hello,
I can't get any of the sample apps running under beta 2.0 I have gone through the tutorials and I can't get them to work.
I get an error saying: Could not resolve <mx:Application> to a component implementation. Main.mxml
I get the same error with the HBox and VBox tag.
On the <SetProperty> tag you are "property = hieght" instead of "name=hieght"
You are going to confuse the hell out of people if you don't update the samples to work with the new Beta's.
Same problems for me
All I want to do is bind a CF query result to a datagrid. So far it's a no goer. I tried casting my result to ArrayCollection but that doesn't work either. Not sure what to try next... :-/
=============
Problem with calling a CFC from Flex 2 Beta 3.
When I use :
<mx:RemoteObject id="phoneService" destination="ColdFusion" result="event.call.resultHandler(event)" fault="event.call.faultHandler(event)" showBusyCursor="true" source="com.mycompany.phones.service.PhoneService" />
I get a message when the app starts saying that it cant find ColdFusion. It seems that the flex-enterprise-services.xml doesn't have the definition for ColdFusion in it.
What should have been added?
Can I add it manually?
I am using a CFMX 7 Multiserver configuration with the flex server on port 8700.
Kevin Roche
