We just switched to CF MX and we have the latest Hot Fix. I can't get a Flash Form to work. I copied code from different tutorials, so I know it's not a coding error. The form displays until I add format="flash" to the <cfform> tag. Has anyone else run into this problem?
Yes - I have this problem too. I wanted a Flash form - grid at top and a hidden text field bound to key of selected row. Binding would not work and grid would not displayl. I have removed the format="Flash" from the form and grid now displays. Binding still would not work. I did a form dump ie <cfdump var=#from#> to see variables from the submit. Interestingly, the columns of the selected row in the grid got passed. So I have been using grdiname.colname to get my key. This worked fine until I did more testing - out of 12 rows, this did not work for rows 4 and 9!! For rows 4 and 9, the grid fields were not passed! So am now back to drawing board. Hence my trip to this forum. :frown;
Although there seem to be numerous reasons why a Flash Form won't compile, the most common one I've found is that somewhere there is a bit of javascript - this has to be converted to actionscript - or some actionscript that is incorrectly formed.
Doug - thanks, but that is something I would not be able to do! Besides, I went CF way as it is supposed to be a complete solution at a hgh level. Macromedia will have to fix this just hope it does not take too long.
Sorry to confuse you, my previous answer was to tbrick. The answer to your question is that you cannot bind to input fields of type hidden. The workaround for this is to set the type to text and then set visible="no". So this works: <cfinput name="myInput" type="text" visible="no" bind="{whatever}"> Unfortunately this leaves a gap on the page, so you need to hide this non-visible input by putting it next to a visible input box in the form like this: <cfformgroup type="horizontal"> <cfinput one that is visible> <cfinput ... visible="no"> </cfformgroup> And that's about the best you can do, a sort of non-hidden, hidden non-visible input !!
Doug, I just cant get format="flash" to work. I have a grid as flash - that works in a norma form. I wanted to use flash form to get consistent look & feel on text boxes and buttons. I have the following which works but will not work with format="flash": <cfform format="flash" name = "formDatasource" skin="#request.skinFlash#" width="100%" action="#myself##xfa.form_submit#"> <cfgrid name = "gridDatasource" format="Flash" font="Arial" fontsize="12" height="300" colHeaderBold = "yes" colHeaderTextColor = "blue" query = "qryDatasource"> <cfgridcolumn name = "AsOf" header = "(AsOf)" display="yes" width="50" type = "numeric"> <cfgridcolumn name = "ID" header = "ID" display="yes" type = "string_nocase"> <cfgridcolumn name = "Type" header = "TYPE" type = "string_nocase"> </cfgrid> <table width="100%" class="menu"> <tr> <td width="15%" valign="top" align="right"> <font class="h2">Start ID:</font> </td> <td width="85%" valign="top"> <cfinput name="startID" type="text"> </td> </tr> <tr> <td width="15%" valign="top" align="right"> <font class="h2">End ID:</font> </td> <td width="85%" valign="top"> <cfinput name="endID" type="text"> </td> </tr> <tr> <td width="15%" valign="top" align="right"> </td> <td width="85%" valign="top"> <br /> <cfinput type = "submit" name="submit" width="100" value = "Submit"> </td> </tr> </table> </cfform> Any suggestions?
You cannot include html inside a flash form unless it is wrapped up in a <cfformitem type="html"></cfformitem> In this case the table has to go. Instead just list the cfinputs using the label attribute in place of the table's left hand column.
Doug, Sorry for not replying earlier, but I have trimmed the code right down and still not work. ie I removed the html code, the grid columns etc. If I leave out format="flash" from the <cfform> tag it works: <cfform> <cfgrid format="flash" name="gridDatasource" query="qryDatasource"> </cfgrid> </cfform> I have tried format="flash" ie at cfforrm - not cfgrid, at cfrom - at cfgrid, not cffrom - at cfgrid, not cform - not cfgrid. Format at cfform just would not work. I have a nasty thought ie I am using Fusebox - with savecontent option. Could this be the reason?! :-( I will do more tests...
Doug, I just removed 'contentvariable=' from my circuit as a quick test - and it works!! :-( I was using cfcontent to format the final page at the end - will now have to think how to get around this. I will have to research and see if other Fuseboxers have had the same problem. Thanks again. Regards, Chun
Doug, is there anyway to debug actionscript as used in cfforms? IT's very hard to know what's wrong when the page just fails to load. I'm just newly trying the flash stuff and don't know Actionscript other than what I'm picking up here and there. At least javascript gives you an error to start from... It appears that if there's any inproper actionscript syntax anywhere, even if it's in a function that's not called, it will still fail? Just wanting to verify that, as JS doesn't fail until runtime of the line generally.
There's no debugging tool that I know of. And you're right, if there's even the tiniest error in the AS the flash form won't compile My method is to always write a simple tester for my CFCs that dumps the contents so I can see if those parts are returning exactly what I want and for the ActionScript part I usually comment out everything in the functions and gradually add it back until the form won't compile. But you need to be careful that the AS not commented out is complete in itself for example, you have to ensure that any starting brace is still accompanied by its ending brace and so on. So generally you end up with lots of logical blocks of the code commented out, but nevertheless in the absence of a proper debugger, I find this quite a quick and efficient method of debugging. Using this method I have found that my most common faults are variable names mistyped and variables not declared, so now I check those first and quite often the code then works at once. If anyone has a better method I would love to hear it.
hope this helps turnon flash form debugging in coldfusion administration.
Doug, I have adapted a similar method. I guess we just get spoiled with some of the features of CF, the debugging being great compared to other programming languages. noodle, great suggestion, I did that. Most of my problems seem to be from improperly formated CF code for flash forms and non-runtime AS issues, as I haven't seen anything pop up with debugging enabled. VZB, thanks for the suggestion, but my problems come from an error in the code, when there's no error it renders.
I haven't thoroughly read the responses above, so forgive me if this was covered. I encountered the same problem when I first starting using our CF server. It turned out that the CFIDE directory was not properly linked through the administrator. On our server, they split it's use between multiple offices, with each office having a different network drive assigned as the www root. The problem was only one drive properly had the CFIDE, and more importantly cfform.js, cfform.swc, and masks.js files, associated. The administrator settings were changed to properly locate these files. I don't work with the administrator side of things, but check how your CFIDE directory is setup. It can make a big difference. I was the only one to begin using flash forms, so they had never noticed that it didn't work. I think this might be a common problem.
Don't see what you're looking for? Try a search.
|