Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
rmarmer #1
Problems mixing Flash & non-Flash form elements...
I have a flash cfgrid wrapped inside a non-flash cfform tag along with other
non-flash form elements. When the user selects a grid row, the flash cfgrid
onchange calls an actionscript, the actionscript calls a javascript function
passing the selecteditem grid row values which are used to populate the other
form elements via javascript & DOM.
I started off cautiously with explicit numerical & string values - not a
problem. But when I tried to pass values dynamically, only the variables
containing numerical values were recognized by the javascript. Below is the
test I ran... here are the results:
Initial Grid Row Values:
someNumber = 578;
someString = "myString";
TEST 1: myVar = someGrid.selecteditem.someNumber;
>> actionscript alert outputs: "578number".
>> javascript alert outputs : "578number".
TEST 2: myVar = someGrid.selecteditem.someString;
>> actionscript alert outputs: "myStringstring".
>> javascript alert fails.
TEST 3: myVar = "578";
>> actionscript alert outputs: "578string".
>> javascript alert outputs : "578number".
TEST 4: myVar = "578";
**changed actionscript getURL() to pass asType instead of myVar...
>> actionscript alert outputs: "578string".
>> javascript alert fails.
I'm viewing in IE, but to check the JS I switched to Firefox & the following
message showed up in the JavaScript Console when it failed on TEST 2:
Error: myString is not defined
Source File: javascript: passStr(myString)
Does anyone know if there is any way to pass dynamically created string
variables to javascript via the getURL() actionscript function?
<script language="javascript">
function passStr(msg)
{
var jsType = typeof(msg);
alert(msg + jsType);
}
</script>
<cfsaveContent variable="onClick">
var myVar = some-grid-row-value;
var asType = typeof(myVar);
alert(myVar + asType);
getURL("javascript:passStr(" + myVar + ")");
</cfsavecontent>
<cfform name="someForm">
<cfgrid name="someGrid" query="someList" onChange="#onClick#"
rowheaders="false" format="flash" >
<cfgridcolumn name="someNumber" header="Job">
<cfgridcolumn name="someString" header="Data?">
</cfgrid>
</cfform>
rmarmer Guest
-
Mixing Flash and Flex
i have a basic question that's probably been answered before. can you mix Flash applications and Flex applications together? for example, i want... -
Problems with flash form cfselect
i have problems with this code, how can i load a data in a cfselect I'm using this code and nothings happend please help me <CFQUERY... -
Flash form load problems
Hi, We have been banging our heads against the wall for some time with flash forms, but now this is a real puzzeler. We have just upgraded one... -
Flash sound mixing
Hi all, I'm facing some problem with the flash cast member and background sound. when i puppet a background sound, the flash member won't play the... -
Problems mixing regular form fields with file uploads
I'm trying to build a form that includes both regular form fields, such as text inputs and checkboxes, along with file uploading. It seems, though,... -
CF_DAWG #2
Re: Problems mixing Flash & non-Flash form elements...
I am having a similar error. I have a flash cfgrid within an HTML form. The
grid is not passing or populating the needed arrays of values to the action
page. I have a case logged with MM support. I will get back to this forum when
I know more.
Thanks!
CF_DAWG Guest
-
rmarmer #3
Re: Problems mixing Flash & non-Flash form elements...
Hey,
I finally got the following to work... note: the single quotes (it's hard to
see with the font used in this forum)
around " + myVar + " but within the paren in 2 & 3 !
See if this does it for you...
javascript: alert(msg + '/' + typeof(msg));
1) myVar = 999;
getURL("javascript:callJS(" + myVar + ")");
js output: 999/number
2) myVar = "myString";
getURL("javascript:callJS('" + myVar + "')");
js output: myString/string
3) myVar = 999;
getURL("javascript:callJS('" + myVar + "')");
js output: 999/string
Just out of curiosity...
The two main reasons that I am not enclosing everything in format=flash
context are:
1) Flexibility!
2) The relative cost in user perception caused by flash forms having to
re-initialize every time the user switches back & forth btw pages...
Howvever, at the same time, & from a "lazy developer" perspective, I'd still
like to use flash form elements if I can arrive at what feels like a reasonable
compromise.
In this case, the compromise is using only the grid in flash format. This buys
me;
1) The benefits of cfgrid in flash format
2) The flexibility to still use html form elements such a s fieldset...
2) The non-flash form elements load immediately, drawing the users attention
to those elements & making the initialization of the flash grid seem to take
less time - or so the logic goes...
What is your rationale around mixing & matching?
Thanks!
rmarmer Guest
-
CF_DAWG #4
Re: Problems mixing Flash & non-Flash form elements...
My rationale is very much the same as your's for using the flash version of
cfgrid.
1. I don't want users to have to download or use the JVM from Sun or Microsoft
in order to use my application.
2. I am not a fan of applets and flash is more light weight.
3. Within my company, we have flash as a standard install on all machines, so
I know it will work on any machine. The applets are hit and miss.
4. I also like the look and feel presented by the flash cfgrid. It provides a
better display of the data and not so much scrolling is need to view it.
Thanks for the info! I will try what you provided. I have not heard anything
back on my case from Macromedia. When I do I will post it.
CF_DAWG Guest



Reply With Quote

