Saturday, March 5, 2005

Loving CFMX 7 Forms

After working heavily with the new forms capabilities in CFMX 7 for the past week or so, I want to personally thank the ColdFusion product engineers for the hard work in this area. This is by far the biggest productivity gain to ColdFusion in quite a while, and when a huge productivity gain like this is added to a tool that already beats the pants of its competitors for productivity, then the competitors better look out!

Since most of what I've been working on lately involves file uploads I've been focusing on the XML forms (XForms) and this is seriously cool stuff. I can finally just worry about the form elements themselves and not spend all my time doing formatting of the display. Not having to create HTML tables for the layout of my forms is a huge time saver, and the flexibility of being able to apply a different skin to my forms makes them extremely reusable. I can definitely see grabbing forms from one app and sticking them into another and just applying a new skin, whereas before it was often more of a pain than it was worth to reuse forms because of all the changes that would be necessary.

Bottom line: CFMX 7 completely rocks for working with forms. Flash Forms are cool as well, but even if you aren't a fan of those, you seriously need to check out XForms. Power, flexibility, and separation of the form elements from their presentation makes for a happy developer!


Agreed, i loathe FLASH Forms.. but damn well near worship the XML Forms + XLST!

I haven't looked into these much yet, but can you do file upload with Flash Forms, and if so, are there any File Upload Progress bars for the form? That has been a huge complaint in the past... having no idea how long an upload will take?

Nope, currently you can't do file uploads with Flash Forms. This is a limitation of the Flash player itself--it doesn't allow for file uploads. It's a frequently-requested feature to be added to the Flash player though, so I bet we'll see this eventually.

Are the XForms compatible with all browsers? Last time I read about them (a while ago) they weren't.

Yes, the XForms that CF generates are compatible with all browsers (no plugin needed) because CF generates standard HTML/CSS stuff on the server side before it's delivered to the user.

I don't think we will see file upload capability in the flash player any time soon. It potentially creates a HUGE security issue. You can do file uploads from flash with a little bit of javascript and the willingness to use a pop-up window. It's not the most elegent solution, but it gets the job done.

Not sure why it creates more of a security issue than any other file upload ... if it worked the same as a regular HTML file upload I don't see what the issue would be. If nothing else it could prompt the user like when a Flash movie tries to access your camera or microphone. I also don't think it'll be that long until it's in there. File upload capabilities are already built into Central so I wouldn't be surprised if it gets into the next version of the Flash player.

Ahh, after looking into it, I was getting XForms confused with the W3C's XForms ( Theirs is the one not compatible with many browsers currently. Once it's supported, it will really change the way forms are created.

Chris--CFMX 7 generates XForms-compliant XML when you use cfform format="xml". You can then apply a "skin" to this XForms-compliant XML, and that's what transforms the XML into HTML. You can grab the XML that CF generates and use it as straight XForms code, however, so the CF forms *do* comply with the W3C XForms standard.

Matt, thanks for the clarification. I just tested it out, and works as you said. Pretty cool!

I'd love to see real life code examples of your XForms.

I have an article that should be up on Fusion Authority before long that gives a simple example. When I finish up our CFUG web site I'll be sharing the code for that whole application and it has quite a few XForms in it.

For anyone else that comes across this entry looking for good examples, Here is the article that Matt mentioned in the comment above.

No comments: