Groups | Blog | Home
all groups > coldfusion flash integration > march 2006 >

coldfusion flash integration : Flash Forms not working


tbrick
3/21/2006 3:43:04 PM
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?
CnR NO[at]SPAM AU
3/22/2006 8:30:45 PM
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;
doug777
3/23/2006 12:00:00 AM
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.

CnR NO[at]SPAM AU
3/25/2006 8:05:21 PM
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.

doug777
3/26/2006 12:00:00 AM
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 !!

CnR NO[at]SPAM AU
3/26/2006 12:56:04 PM
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">&nbsp;
</td>
<td width="85%" valign="top">
<br />
<cfinput type = "submit" name="submit" width="100" value = "Submit">
</td>
</tr>
</table>
</cfform>

Any suggestions?


doug777
3/27/2006 12:00:00 AM
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.

CnR NO[at]SPAM AU
3/29/2006 8:20:11 PM
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...


CnR NO[at]SPAM AU
3/29/2006 8:27:34 PM
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
furious70
3/31/2006 3:51:12 PM
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.
doug777
4/1/2006 12:00:00 AM
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.

noodleweb
4/4/2006 6:30:22 PM
hope this helps
turnon flash form debugging in coldfusion administration.
VZB_CF
4/5/2006 9:00:49 PM
Check these links out...this should help you...I had the same problem in an IIS
environment:

http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=d9734ed8
http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_18307
furious70
4/5/2006 9:14:30 PM
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.
Trevor at IU
4/6/2006 8:39:31 PM
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.
AddThis Social Bookmark Button