Brad asks:
What are pros and cons for using flash forms with coldfusion? I would like to try them but I would like to see pros and cons first before I make a decision in using them for an application.
Since the release of CFMX7, I've changed my mind a bit about Flash Forms. When it first came out, I wanted to use them everywhere. In fact, Lighthouse Pro, my bug tracker, did just that. I quickly came to realize that this was not working well so I removed them all. Does that mean I don't like the feature? Of course not! I still think it is a cool feature, but I think you need to carefully consider where to use them. Let me try to cover some of the pros and cons (in my opinion):
Pros:
Flash Forms (and Flash/Flex in general) allow for much more powerful form controls then what you get out of the box. Some of what Flash Forms can do can also be done in DHTML, but I dare you to find a system as easy to use as Flash Forms. Consider the simple grid. It takes all of 2 minutes to add to a page and gives you a nice way to present a large table. You get sorting, you get a nice scroll bar, etc. I think the grid is probably my favorite aspect of Flash Forms.
Another aspect I like about the forms is the layout controls. I hate building forms, and I like how Flash Forms makes this much simpler and let's me forget about tables for a while. (Yes, I know I can build my forms with CSS. I suck at CSS.)
So I think, in general, the pros are the enhanced capabilities of the form (grid controls, calendar controls, etc) along with the ease of use.
Cons:
First off - you need to require Flash. I think most folks are ok with that, especially with the penetration of the Flash plugin.
The biggest con for me though is the overhead. If you build a little 3 field Flash Form you will be really slowing down your page for what should be an extremely quick display. I don't blame Flash Forms for this - but it goes back to what I mentioned before - knowing where to use them. When I used them everywhere for Lighthouse Pro, I was making a mistake. Flash Forms are slower to load. For a complex form, it is more than worth it. For a simple form, you want to use basic HTML.
Lastly - Flash Forms are powerful, but you can't do everything. A lot of times you find yourself "hitting the wall" in what is possible. So you end up with a result that is "almost perfect" and so close to what you want, but not quite there.
So where do I fit in now? I will continue to use Flash Forms for grids and multi-step forms (like check out processes), but I'm using them a bit less now then when I first started working with CFMX7. I'm also turning my attention a heck of a lot more to Flex 2. In fact, I'm thinking about ways I can build some functionality into a Flex2 app such that it can be controlled via ColdFusion via custom tags. (As always, finding the time is the issue.)
I know my readers will have some pretty varied responses to this, so let me know what you think.
Archived Comments
I love flash forms. They ARE slower so in some applications I actually have both html and flash forms... I didn't think anyone would use the flash version because they were so much slower but they do. Flash player 9 will speed up flash forms dramatically (although they will still be slower). I have been forced to learn a little ActionScript to get them to do some stuff which was scary at first but it's growing on me. The problem with the cfgrid is you can't do a combo box and that's a deal-killer for editable grids. I too am thinking Flex will be where I turn for complex user interfaces in the future.
Ray,
Another Con is the size limit on the form. You can't go past that limit. This is a pain, if you want to create a more complex form.
Luis
I spent quite a bit of time modifying the Real Estate example to fit my need for an inventory management system for an online store. It came out exactly as you describe, Ray. It was very cool, I could do things that were very hard or impossible with DHTML. I learned some ActionScript and some things about Flash. In the end, I discovered that it was about 80% of what I wanted, and every new feature I added would be days of work due to my lack of knowledge of Flash/AS and some of the limitations of the tool. I still think Flash forms are cool, but I'm much more conservative when I use them. Not sold on Flex yet, but watching carefully.
I went through a similar process as you did. Once I saw what ASFusion was doing, I wanted to use Flash Forms everywhere, but then not only do they load somewhat slow (which wasn't a big deal when you could incorporate alot of functionality on a single page without page loads using remoting), but I spent so much time debugging arcane issues mostly having to do with trying to make Flash Forms do things they were not originally intended to do (for example, I remember spending way too much time trying to get around the inability to use "new"). In the end, I still like them, but in limited use.
flashforms are great, we've pretty much been able to do what we needed doing w/them, just usually needed some more AS (which makes you learn AS). w/flashforms we only have one rule, you never submit them. these things should be the app's UI, not 100% replacements for HTML forms.
At one time there was a big push for using Flash for forms - I think it was TJ Maxx that had the $100,000 shopping cart - but it seems to have disappeared?
I agree with all Ray's points - it will be interesting to see if Flex improves upon some of these issues.
The calendar control is the only feature that I really find worth the loading lag time. Fortunately, it can be included in a standard html form. The tabbed form controls are also nice in the rare case I need them.
that darn load time, and ALMOST being perfect gets me most times... i spent 3 weeks making this killer little app, that made great use of flash forms, in cfmx 7, and when i got to the ALMOST dont stage, it was ALMOST good enough, and then scrapped it, rolled my own dopeness in CSS, and its all good now.
like most, im probably stuck waiting in the hinterland until they become better/faster/easier to implement.
my favorite thing was to try and have a submit button centered in a panel.
I had a good result with a flash form here - http://www.residentialrepor... - and it wasn't that difficult - mainly adjusting the layout (width, height, etc).
I really like what flash forms can do. Like Ray said, they are a great way to quickly create a robust calendar control or grid. I've done some apps that do considerably more than that, and its a fairly painful process, working around limitations, some puposefully built into CF. I've worked with Flex2 a fair amount, and I'm excited about the doors that will open up. Obviously, flex gets around all the limitations that flash forms have built into them. You might say that your options are more flexible? No? Wow. I couldnt resist.
Anyways, with the overhead of Flex and flash forms, I have adopted a policy of only using them for internal apps. On internal apps that I've worked on, I can generally assume that the form/movie will be loaded and a fair amount of interaction will take place, making the initial loading overhead worthwhile. As for public sites and projects, I'd rather stay away from loading an entire flash movie for what might be a single view.
I've found Flash forms in CF almost completely useless unless you use Remoting to retreive and store data from them without reloading the page.
Doing this I've created forms that a user can perform a search with and return the results into a grid without a page reload which is a great time saver.
I've also created much more complicated forms that are incredible time savers because they let the user do so much without having to load and submit a dozen different forms.
While you might think that Flash is "everywhere", it's really not in the world of locked-down standard desktops -- like the government agency for which I contract...Even if I had a desire to do something like that, over half my audience would be lost...and ultimately my goal is to insure EVERYONE in the targeted audience can see and use my content...
Brian, certainly true, but in your case, you know ahead of time that Flash isn't an option.
Excellent post. I too found myself "flash form happy" with the release of CF7, but have almost entirely eliminated their use from my code. Funny thing is though I've never found a use for xForms which are supposed to be "the future" of forms... I just don't see it.
When cf flashforms first hit town, I developed a lovely mailing list application with it. But on deploying it, it was so slow, especially for those of us in Nigeria with limited bandwidth.
I have since junked flashforms. The time it took me to recode the interface was enough lesson for me.
Even the grid controls listed in Ray's Pros have issues. When you get a couple hundred results in a grid the Flash Player starts hogging a lot more memory, performing much more slowly, and I've seen browsers crash.
Maybe Flash player 9 will help with this.
I've been using Flash Forms quite a bit recently to build the configuration and reporting interface for my web-app. It's the first Flash Form I've done and is more of an experiment than anything else. I must say, I have very, very mixed feelings about Flash Forms now.
Some things were very quick and simple - getting the form set up and looking pretty was cake. Getting data using remoting was easy too, as was getting it on the form, but updating the data was an absolute nightmare. As an example, if you populate a dataProvider from a query returned using remoting and then manually add another item to the same dataProvider, it updates the screen but dataProvider.length doesn't increment. You have to take a copy of the contents, add your item to the copy, then re-set the dataProvider using the copy.
That's just one little example of the several little problems that wasted days of time figuring out what was happening and trying to fix it. Others include changing a date formats being a pain, and file upload/download not being possible unless you use a seperate SWF built in Flash.
Now that I know about them the next app I develop won't take as long. However, I still think I could get the same functionality built in half the time using DHTML. It just wouldn't look anywhere near as pretty as a Flash Form ;)
I've built some very heavy applications built with flash forms, for more than just passing data to and from pages. I ABSOLUTELY LOVE THEM! My most recent project was a dashboard application for an enterpise level productivity and quality results. Flash forms allow me to integrate graphs, grids, and then some very slick styles including tabs, colors, and text formating.
Way to go Macromedia for bringing these to the world.
Great post. I agree with most of the above. I'd add that the debugging or lack therof really sucks. I've spent tons of time trying to just figure out why my form wont load. What ever happened to error messages?
I do like the way they look. I dont think I will stick with flashforms but I am flex curious!
Personally I find the problem with form data retention a pain in the a$$. Such as using a back button on a verification page to allow the user to go back and edit what they have already entered on the main form. Setting the timeout property doesnt work properly and the user has to start the entry process over again. Coding for this problem exceeds the compile limit quickly on a complex form. Bollocks!