I am not sure if any of you have had this issue, but I found a solution with the much appreciated assistance from Laura of ASFusion.com I have included our back and forth emails below to help you understand my solution so maybe it will help those of you who need this:
Justin,
Didn't I tell you so? ;)
How you did that is not recommended (will cause recompiling of the form every time that value changes), however, I see why you did it that way. Now, to avoid that... the cleanest way is to use an extra hidden field to store the original value and then use it in the bind: bind="{sameAddress.selected ? subscriberEdit.bCity : myFormName.MyHiddenField}"
Otherwise use a hack (not recommended)
bind="{sameAddress.selected ?
subscriberEdit.bCity : remoteObject_myFormName.getData.result['sCity']}" value="#qExample.cityName#"
Hope that helps,
Laura
Justin Cook wrote: Laura,
I think it has to do with this particular code:
<cfinput name="sCity" type="text" width="150" maxlength="50" required="yes" validateat="onsubmit" message="Please provide the subscriber's city." label="City: " bind="{sameAddress.selected ? subscriberEdit.bCity : '#qSubscriber.sCity#'}"/>
I have the bind because there's the option of having the same address on business and shipping. How can I change this and it still work?
::::::::::::::::::::::::::
Justin Cook
Web Developer :: Macromedia Certified
Justin,
Not sure what to tell you. I
don't get any error when running your example with a query that returns 'New York'. I tested in 2 servers, 2 OSs. As I said, that alone should not give an error.
Are you sure that alone gives you an error?
Cheers,
Laura
Justin Cook wrote:
Laura,
Your email begs me to ask you the question, then, if I have a query on the page and I output the query such as:
<cfquery name="qExample" datasource="ex">
SELECT *
FROM cities
</cfquery>
<cfform format="flash">
<cfinput name="bCity" type="text" width="150" maxlength="50" required="yes" validateat="onsubmit" message="Please provide the subscriber's city." label="City: " value="#qExample.cityName#"/>
</cfform>
Where the output includes the city name of New York. What happens? Because that's when I get the error?
Your continued assistance is greatly appreciated!
Justin,
Flash forms *always* load the data via remoting, even if you have a simple example like:
You don't need to do anything special, that's the way they work...
The reason I mentioned remoting was to help you understand why the above works but something like this doesn't:
<cfform format="flash">
<cfinput name="bCity" type="text" width="150" maxlength="50" required="yes" validateat="onsubmit" message="Please provide the subscriber's city." label="City: " value="Some city" />
</cfform>
Note that the difference is that 'New York' is written into an alert in ActionScript, which is set at compile time, when the 'new' checker runs.
Cheers,
Laura
Justin Cook wrote: I will have to revisit my form and see how to implement Remoting with that form and then I will let you know how it worked out.
Thanks and have a great day,
Justin,
Sorry for the late reply.
I don't see any problem while running your example (substituting the variable for "New York"), and there shouldn't be any problem, since whatever
is set in the value attribute is sent via remoting after the form has compiled, so the checking for "new" should not complain.
As I said, that only happens when the word gets written in actionScript (or tooltips). The blog post you show me does that, writes data into ActionScript, which is a bad practice.
Perhaps you could pinpoint where that happens exactly...
Laura
Justin Cook wrote: Laura,
I have a query on the page which pulls the data from the db, then I have the form and I have the data output as follows:
<cfinput name="bCity" type="text" width="150" maxlength="50" required="yes" validateat="onsubmit" message="Please provide the subscriber's city." label="City: " value="#qSubscriber.bcity#"/>
Since this is a little different than your example that you
emailed me, I'm still quite confused. Please pardon my ignorance. The query is outside of the cfform tag. I have the cfform surrounded by cfoutput tags and then have my form tags set up similar to what I have above. If I don't include the data in this format, then how would you suggest I do it so that I don't run into the problem that I am running into. Here's a link to a blog post I found of others having the same issue:
I hope you get a chance to help, because I am at a
loss.
Thanks,
Justin
Justin,
I don't really know what you are doing exactly, but that problem arises *only* when the word is written into ActionScript at compile time (you either write it yourself or make CF write it for you). Writing dynamic data on ActionScript directly is a bad practice really, as it will make your form recompile every time the data changes. Even if the data does not change, it is not a good idea to write 50000
records in AS code. If you look at this example: http://www.asfusion.com/examples/item/multiple-selects-related-flash-cfform you will see that New York is there, and there is no ActionScript problem. Why? because we don't loop over the records with CF writing ActionScript (somewhat like the blog post you showed me, where the data might be pushed on an array at each iteration of the cfoutput loop), but rather load the data normally, which it is done via Remoting under the covers. Then we do whatever we need to do with the data (in which case it will be strings for AS, not the word 'new'), for example, loop over the records, filter them, etc.
Cheers,
Laura
Justin Cook wrote: The error occurs when the cfm page runs and the data is pulled
out of the database that contains the word "new". For example, we have a subscriber form. When we want to edit a subscriber, we click on a person's name and the page loads with the Flash Form. Data is pulled out of the database to prefill the form. If, however, the data contains one of the reserved words, such as New York City. An error is thrown. And we get a CF error with an illegal use of a reserved word in actionscript error. I have manually changed a couple of items in the database so that for example I now have New_York City. But there are over 50,000 records in the database so I need a long term solution to fix this problem. I found one solution online, but that's not something that is doable for us...or at least I don't think it is. Here is the link to that blog post:
http://mkruger.cfwebtools.com/index.cfm/2005/8/29/flash%20form%20limitation
Your expert help would be greatly appreciated Laura!!!
Thanks,
Justin,
Do you see the error when compiling the form?
Laura
Justin Cook wrote: Hi, I have developed several applications with Flash forms and am running into an issue that I can't seem to find the solution for. The forms prefill with data from a database and if the data includes the word new (e.g. New York City), I get an ActionScript error. Is there a work around for this problem?
Thanks,
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
justin cook
web developer :: macromedia certified
_______________________________________________
Reply to DFWCFUG:
[email protected]
Subscribe/Unsubscribe:
http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
http://www.mail-archive.com/list%40list.dfwcfug.org/
http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
www.HostMySite.com
www.teksystems.com/