ColdFusion Flash Forms Macromedia Developer Center article - Part 2
We've had very good feedback from the first part of the ColdFusion Flash Forms article published at Macromedia. Thank you!
Many of you have asked when the second part is going to be published. The answer is: soon! But some readers have asked Macromedia and us to be able to see it sooner. So we decided to post it here for download until it is finally published at the Macromedia Developer Center.
Enjoy!
Update: The article has been published by Adobe, so these are the new links
The Real Estate Sample Application - Part 2: Managing Property Listings through Flash Forms
Sample files
Live example
Related posts: ColdFusion Flash Forms Macromedia Developer Center article - Part 1
Michael White
Jorge Tejada
Granville Barnett
Really good stuff keep it up :)
Josh Rodgers
I had Part 1 installed, and it was working fine.
I recoppied the new files over the old ones and tried to hit the index.cfm page.
Heres what i got:
Element STATESGATEWAY is undefined in a Java object of type class [Ljava.lang.String; referenced as
The error occurred in C:\JRun4\servers\cfflex\cfusion.ear\cfusion.war\realestate\index.cfm: line 6
4 :
5 : //get all states
6 : getstate = request.statesGateway.getAll();
7 :
8 : //make a query of prices
Josh Rodgers
FIxed looks fantastic!
Thanks for your hard work.
Vince
In the real estate example, if no results are returned when you search for a property, how could you capture that and either : call another function or event?
I'd like to do something similar to your search functionality, but if nothing is returned in 'result', I want to create an alert that says " no records found, etc...". I haven't had any luck so far.
Thanks for any help!
David
Xerrano
I just install this new version, but Im getting an error message when trying to search or adding a new property.
This is the error message:
___________________________________________
Error: Service
realestate.services.ListingService not found.
___________________________________________
I can see the file "ListingService.cfc" in the services directory...
ANY IDEAS... THANKS!
Zach Stepek
Just a shot in the dark, but are you sure that remoting is enabled on the server? I was receiving similar errors with another app, and that was the issue, my host hadn't enabled the flash remoting gateway on my CF server.
Hope this Helps
Xerrano
You may be right, that could be the issue to my problem
Last week I upgrade my coldfusion 6.5 to 7.0.1 (mac os x).
Practicaly Im new to coldfusion.
Is there a way you can point me the way to see if flash remoting
is enable in my server?
Do I need to have any sort of path poting to a folder in the Administrator?
Or any other ideas?
THANKS AGAIN
Xerrano
My fault 100%
I place "realestate" folder inside another folder "cfapps" in my "wwwroot"; when I change the "componentPath" variable to "cfapps.realestate" everything worked fine.
THANKS FOR YOUR TIME
Xerrano
YOU KNOW IF MYSQL 5.0 CAN BE USE WITH THIS APP?
The "mysql.sql" file was successfully installed!
Im getting this error: "Error Executing Database Query."
is this related to mysql version?
Thanks
Jorge Tejada
http://www.richinternet.de/blog/index.cfm?mode=entry&entry=DB40A25F-F614-7FEC-F79453ADCC540BA1
David
Thanks again for this great tutorial! I was wondering how you would handle more than one table, even better two related tables, in a set up such as this. I'm working on a wine application right now where i have wineries (1st table) that produce many wines (2nd/child table) that are used by glass or bottle (3rd/child table). My first thought was to create a seperate interface with each but seems like alot of unnecessary code. My seconde thought was to create a single form that had a grid of all wines, with an accordian below of the winery, wines, and uses, but that seems a little tricky for add/updates. How would you handle a common scenario like this in flash forms? Would love to hear your thoughts! :)
Thanks again for all your generousity!
Best regards,
David
David
Here is those two functions that i have:
public function setUpRemoting():Void{
<cfoutput><!--- cfoutput to be able to set the gateway dynamically. It is recommended however to write the actual gateway instead --->
var connection:mx.remoting.Connection = mx.remoting.NetServices.createGatewayConnection("http://#cgi.HTTP_HOST#/flashservices/gateway/");
var componentPath:String = "#request.componentPath#.services.menuService";
</cfoutput>
var responseHandler:Object = {};
<!--- put controls in the responseHandler's scope --->
var menuGrid:mx.controls.DataGrid = menuGrid;
<!--- handle search by default onResult function --->
responseHandler.onResult = function( results: Object ):Void {
menuGrid.dataProvider = results;
_root.setMode('add');
mx.managers.CursorManager.removeBusyCursor();
}
<!--- handle create response --->
responseHandler.create_Result = function( results: Object ):Void {
if (results.status){
menuGrid.addItemAt(0,results.item);
_root.setMode('add');
}
mx.managers.CursorManager.removeBusyCursor();
//show a message
alert(results.message);
}
<!--- handle update response --->
responseHandler.update_Result = function( results: Object ):Void {
var item:Object = results.item;
var index:Number = _root.findItem(menuGrid,'MenuItemID',item.MenuItemID);
if (results.status && index >= 0){
menuGrid.replaceItemAt(index,item);
}
mx.managers.CursorManager.removeBusyCursor();
<!--- show a message --->
alert(results.message);
}
<!--- handle remove response --->
responseHandler.remove_Result = function( results: Object ):Void {
if (results.status){
menuGrid.removeItemAt(_root.findItem(menuGrid,'MenuItemID',results.item.MenuItemID));
_root.setMode('add');
}
mx.managers.CursorManager.removeBusyCursor();
<!--- show a message --->
alert(results.message);
}
<!--- default error handler --->
responseHandler.onStatus = function( stat: Object ):Void {
<!--- if there is any error, show an alert --->
alert("Error: " + stat.description);
mx.managers.CursorManager.removeBusyCursor();
}
<!--- store service in global variable --->
form_menuItems.myGlobalObjects.menuService = connection.getService(componentPath, responseHandler );
}
and here is the other:
<!--- function that gets called when grid selection changes, used to bind other controls to grid values --->
public function menuGridChanged():Void {
if(menuGrid.selectedItem == undefined) {
setMode('add');
}
else {
setMode('edit');
}
menuGrid.setFocus();
}
I think my remoting function is right:
<!--- editing / adding a menu item --->
public function submitEdit():Void {
var editArguments:Object = {};
<!--- simple text inputs --->
editArguments.MenuItemID = edit_MenuItemID.text;
editArguments.MenuItemName = edit_MenuItemName.text;
editArguments.MenuItemDescription = edit_MenuItemDescription.text;
<!--- checkboxes --->
editArguments.MenuItemActive = edit_MenuItemActive.selected;
<!--- only make call if all required fields are supplied --->
if( mx.validators.Validator.isStructureValid(this, 'form_menuItems') ){
<!--- show clock cursor --->
mx.managers.CursorManager.setBusyCursor();
if (form_menuItems.myGlobalObjects.isEditMode) {
<!--- call service --->
form_menuItems.myGlobalObjects.menuService.updateMenuItem(editArguments);
}
else {
<!--- call service --->
form_menuItems.myGlobalObjects.menuService.createMenuItem(editArguments);
}
}
}
<!--- removing a listing --->
public function submitRemove():Void {
<!--- call service, sending the id --->
form_menuItems.myGlobalObjects.menuService.removeMenuItem(edit_MenuItemID.text);
}
Would greatly appreciate any advice.
Thanks again,
David
Steve
I modified the code and it works to a point. The gateway returns the query results to the grid. However, I can't get the form or service to pass the arguments to the query.
I've even tried hard coding the values in the ListingService component to pass to the query, but that doesn't seem to work either.
Here is my code for the service, gateway and form. Any assistance would be greatly appreciated as this is the only block I have to get this moving.
Service:
<cfargument name="teacher" required="no" type="numeric" default="0" hint="Primary key"/>
<cfargument name="fromDate" required="no" type="string" default="" hint="Search From Date" />
<!--- call a component sitting in memory (application scope) --->
Index:
function submitSearch():Void
{
<!--- get all the search criteria items --->
var searchArguments = {};
<!--- simple text input --->
searchArguments.date = search_fromDate.text;
<!--- dropdowns --->
searchArguments.teacher = search_teacher.value;
<!--- show clock cursor --->
mx.managers.CursorManager.setBusyCursor();
<!--- call service --->
Homework.myGlobalObjects.ListingService.search(searchArguments);
}
<cfreturn application.ListingGateway.search(argumentCollection=arguments) />
Thanks,
Steve
Zannie McRae
McRae
BM
Josh Rodgers
I basically want to populate a grid from a query.
Based on the users selection I then want to go grab more data from another query that joins some tables together and then bind that result to my forminputs, dropdowns etc..
How in the world do I do that? I am stumped atm.
please help me :)
Zannie McRae
xerrano
Chaz
Laura or Nahuel,
I have the same problem Xerrano was having.
This is the error message:
___________________________________________
Error: Service
Component.RemoteAccess.RDBMSPMAPService not found.
___________________________________________
I've done the solution Xerrano did and I am still having this problem and remoting is enabled on the server.
This is the setup of the folders under the wwwroot
wwwroot
-Component
--RemoteAccess
cfc's
-MainFolder
--SubFolder
---Folder this app
----Component
-----RemoteAccess
cfc's
RDBMSPMAPGateway
RDBMSPMAPService
I added the components under the app folder to see if this will work, but all of the remote access cfc's are under the root in a folder called component.
can you help me with this problem.
Thanks
Chaz
I found the problem
Chaz
can you help me with this problem.
___________________________________________
Error: CF Adapter: Service
_cf_Templates.PMAP.Component.RemoteAccess.
RDBMSPMAPService does not have method
"getSummaryResults" that matches the name
and parameters provided.
___________________________________________
I get this problem when call a component sitting in memory (application scope)
if i do not call that component and put everything in the first componet everthing works fine.
Josh Rodgers
I used a helper function you wrote for the realestate app when handling selections of a cfselect dropdown, I now want to do the same thing with a cfselect listbox (size attribute used) however I am having some issues.
Heres the code I am using. I hard coded the array, so you know what I am returning, any idea what I am doing wrong, im not a AS wiz:
var Roles:Array = Array(4000, 4001, 4002);
<!--- Listbox --note using helper function from below to select right options--->
_root.selectList(_root.edit_Roles, Roles);
Helper Function:
<!--- helper function to select items in a list --->
public function selectList(select: mx.controls.List, optionsToSelect:Array):Void{
//go through every record to find the right one
for (var i:Number = 0; i < optionsToSelect.length; ++i) {
if (select.getItemAt([i]).data == optionsToSelect[i]){
select.selectedIndices = i;
break;
}
}
}
Xerrano
thanks!
Chaz
I was looking at the wrong folders.
The way the site was setup wwwroot is not my root. my root dir is under wwwroot.
wwwroot
-component (I put my cfc's here)
-mywwwroot
--component (this is were it was looking for them)
Janice
I have build an application similar to this one, only it needs to include a login form and use session variables to ensure that the user is logged in before accessing it.
I was just wondering if anyone knows of some examples of using flash remoting and a login with session variables. I have found a couple of articles for one or the other but not both and I can't seem to get it working.
Any help would be greatly appreciated!
Laura
It all depends on your application, the amount of data you need to show for each child table, the space you have in the gui, etc. Having everything in one place is good only if it is easy to use, otherwise, it just becomes so complex nobody can use it. At this point, we are leaving the realm of coding to the realm of GUI design and usability, and we believe that GUI is one of the most important factors that can either make an application a success or a failure. Regarding complexity, Flash forms may not be the best way to handle it, as it is difficult to create panels that hide, show, move, etc. So you only have a fixed amount of space to work with. For bigger applications, I would strongly recommend to look at Flex.
David,
Can't really tell what your problem is. I would recommend you to start with the sample code that works and start modifying from there to see at what point is stops working.
Steve,
First, I am not sure if you have <cfreturn> in the index file or the service. Probably in the service where it should go because you have that part working. Anyway, assuming you have that part right, from what I see, it is sending the teacher but not the date to the service. The properties of the searchArguments object should be named the same as the component arguments. Since you are only passing 2 arguments, you can also use this to avoid using the arguments' names:
Homework.myGlobalObjects.ListingService.search( search_teacher.value,search_fromDate.text)
I would also put some trace/alert or something to see if search_teacher.value and search_fromDate.text have the correct values.
Zannie,
onload does not work as you may think. Look at this post: http://www.asfusion.com/blog/entry/knowing-when-the-cfform-data-arrives
Also, there are only a few reasons to use Flash remoting to populate data on onload, since it has the same effect as loading the data normally (specifying a query in the tag directly). Watch out for unnecessarily added complexity.
Also, try not to use cfsavecontent now that we have functions.
Regarding your second question, the problem is not that flash forms do not support user defined functions, because after the updater, they do. The problem is the scope. When declaring functions on an object directly like we do when assigning handler functions to the response handler or event listeners, they do not have access to the controls directly. The same happens with other functions, the easiest way to use them is to use _root as in _root.getURL(). There are other ways, like putting the functions into scope like we do for the other controls. Using _root is not very elegant, so I try to avoid it as much as possible.
xerrano,
Have not tried mySql 5, but I'll check to see if it is possible
Josh,
selectedIndices takes an array, not single numbers. You will have to construct a temporary array in your loop and then assign it to selectedIndices.
Janice,
You can reference session variables in your services directly. Flash sends session variables each time it makes a call.
Zannie McRae
I looked at the posting of when the data arrives and was able to solve the problem, but as you indicated that it can get a little confusing, so I elected to use the query option of the select component.
Regards to the second question that worked like a charmed. So I guess it would be best to place everything with scope to avoid _root or scoping problems.
McRae
Josh Rodgers
<!--- helper function to select items in a list --->
public function selectList(select: mx.controls.List, optionsToSelect:Array, arrayLength:Number):Void{
// start first loop based on array length
var toSelect:Array = [];
for (var i:Number = 0; i < arrayLength; i++) {
//Next Loop is based on listbox index length - it has 8 indexes
//go through every record in listbox to
//find the right ones and select them
for (var z:Number = 0; z < select.length; z++) {
if (select.getItemAt([z]).data == optionsToSelect[i]){
toSelect.push(z);
}
}
}
select.selectedIndices = toSelect;
}
<!--- helper function to get items selected in a list --->
public function listResults(select: mx.controls.List, selectionMade:Array):Array {
// start first loop based on array length
var fromSelect:Array = [];
var x:Number;
for (var i:Number = 0; i < select.length; i++) {
for (var index:String in selectionMade){
if (selectionMade[index] == i){
x = select.getItemAt([i]).data;
fromSelect.push(x);
}
}
}
return fromSelect;
}
Scott
stephenwightman
Attribute validation error for tag CFFORMITEM.
The value of the attribute TYPE, which is currently "script", must be one of the values: HRULE,HTML,TEXT,VRULE,SPACER.
The error occurred in C:\CFusionMX7\wwwroot\test\realestate\index.cfm: line 66
Called from C:\CFusionMX7\wwwroot\test\realestate\index.cfm: line 65
Called from C:\CFusionMX7\wwwroot\test\realestate\index.cfm: line 1
64 : <table id="container"><tr><td>
65 : <cfform name="RealEstateAdmin" format="flash" width="990" height="610" onload="formOnLoad()" style="themeColor:##56A1E1; marginRight:-12; background-color:##37749D;">
66 : <cfformitem type="script">
67 : public function formOnLoad():Void{
68 :
PS: I'm also very interested in how to implement the same question 'janice' asked - adding a login feature...
Luis Alvarez
Thanks for you app. Its really allowed me to take cf development in another directions. I'm currently building an RIA that must create tabs in tabnavigator dynamically depending on what accountis chosen in a grid, additionally dynanic fields. I kown Flex has a createchild() function. Any way of doing this in cf7?
Any direction would helpful.
Thank you!
-Luis
Laura
yes, it is possible. I'll try to make an example when I get a chance.
stephen,
You need the CF Updater 7.01 to run this app.
Luis,
You can't use createchild, but you could use a repeater instead.
Jen Mostert
Thank you very much for sharing your code and all of your wonderful knowledge! I can't thank you enough.
I have one question for you when you have time. I tried using your format for getstate to call a getrace function in my RaceGateway component. I added the correct lines in my application.cfc file and am trying to populate a cfselect just like you did in the Real Estate app. I keep getting an error: The value returned from function getRace() is not of type query.
If the component name is specified as a return type, the reason for this error might be that a definition file for such component cannot be found or is not accessible. I've looked and looked at the code and everything appears to be spelled correctly and the variables appear to be named correctly. Do you have any suggestions of what I could be doing wrong? Thank you for your time and thanks again for all of your examples. I truly appreciate it.
Jen Mostert
thoughtbox
Xerrano
Michele
Chaz
My questions are first
I’m losing my record numbers from displaying when I resize my datagrid.
i.e.
with(dgListStandarsReport)
{
dataProvider = results;
selectedIndex = undefined;
setSize(610,numDataGridTableHeight);
};//End of with(dgListStandarsReport)
How do I format number in the datagrid? I using numberformat="999.99", but this is not working.
Jen Mostert
Prem
On the other hand when the bind attribute is used the date display changes but when you click on the input field the date selected is todays date.
Anyone got a fix on this?
Thanks
Joel
Reinhart Jansen
<cfset variables.dsn = arguments.dns />
shouldn't this state arguments.DSN?
Btw, thank you so much for the clear examples! I would never have used the Flash version of CFFORM if it hadn't been for you...
Chaz
I need the ability to change results dynamically, how will I do this..
<cfformgroup type="repeater"
id="RepeaterIDName"
query="qRepaterResults"
startrow="0"
maxrows="# qRepaterResults.recordcount#"
visible="yes"
enabled="yes">
Thanks
Alex
Vincent
Will this application work with the Standard Edition or do you need the Professional Edition to use the gateway service and Flash remoting?
I looked in the doc but I'm kind of confused about the answer I found :-/
Thanks,
Vincent
Vincent
Obviously this works well with the developer edition but what would be needed if I'd use this technique for a client's project?
Will the standard edition be enough?
Thank you so much for this tutorial. It's awesome!
Vincent
arija
Sakang
it enables the user to come back and finish the form at a later time. I have already implemented this form using a traditional
html form. The way I implemented it in a traditional form approach is that I submit the form and save the data into
the database upon submitting it. (Each step comprises one form so there are total of 5 forms in the application.) When the user
comes back to finish filling them out, I just simply goes back to the DB and retrieve the data and pre-filling the parts the user
already filled out then continue with the rest.
Now I wanted to convert the form into flash form with Flash Remoting that will allow the using to submit and retrieve
data without leaving the form. I have arranged the form into tab interface, each tab equals to one step. There are five
tabs total. I am able to submit the form and retrieve data back using flash remoting. However, the biggest challenge I am
facing is how can I submit only parts of the form? I need to be able to distinguish which part of the form controls I am
submitting and which controls I need to validate before I submit and store data. In the traditional form, it was easy
because each step was its own form so I could only apply appropriate validations and required fields on the appropriate
appropriate form and only submit that form data to DB. However, since this flash form version is only a one, continues form
all controls will be submitted and all required fields will try to validate eventhough you are only submitting parts of it.
Does anybody have an advise on how I can make this work with the flash form using the same implementation i have in the traditional form.
thanks everyone!
Adrian Showalter
Jeff Bouley
Please see my blog to integrate session management into your flash form application. I think my code is what you're looking for:
http://blog.strikefish.com/index.cfm?mode=entry&entry=EC1E92BC-CF0D-5F0F-C6B1FE5B951D85A9
Vincent
One minor thing however:
- when the form is submitted (add or update), is there a way to validate using alerts in addition to the error messages in the field?
Basically, I'd like to get the same function as the "onsubmit, on server"
Even though all my fields have "validateat="onsubmit, onserver", the alert box doesn't show up when validated.
Adrian Showalter
I did this by adding
if( mx.validators.Validator.isStructureValid(this, 'YourFormName') ){
// do submit or remoting here
}
to the function called when the submit button is pressed. I think that will do what you are looking for.
Vincent
that's what I currently have.
The problem is that the validation is made in the fields but not as an alert even if each field is assigned the "validateat:onsubmit, on server"
My understanding is that the function bypasses the "validateat" but I don't know how to call it in ActionScript.
Vincent
Janice
I used the code below and it seemed to work pretty well. Hopefully it will help you out.
if( mx.validators.Validator.isStructureValid(this, 'yourformname') ){
mx.managers.CursorManager.setBusyCursor();
var errCount:Number=0;
var errMessage="";
var isOk:Boolean=true;
if (_root.fieldname.length == 0) {
errCount=errCount+1;
errMessage=errMessage+"("+errCount+") Error message text here...";
isOk=false;
}
if (_root.2ndfieldname.length == 0) {
errCount=errCount+1;
errMessage=errMessage+"("+errCount+") Error message for 2nd field here...";
isOk=false;
}
if(not isOk) {
errMessage=errCount+" form error(s) found.\n\n"+errMessage;
alert(errMessage, "Warning");
mx.managers.CursorManager.removeBusyCursor();
}else{
//do remoting here
}
JDB
Any idea why I would be getting the following error when clicking on the 'search' button:
"Service threw an exception during method invocation: null"
Thanks!
Bytor
I've been a CF developer for about 5 years now and stumbled upon this site and OH BOY did it lite a fire under my butt!
Thanx to your excellent tutorials and examples, I have whipped out an app in the past 4 days.
http://www.bytorproductions.com/projects/work/products2/
Next step, getting the bad boy to update via remote calls!
Keep up the great work!
Brian Hudson
Thank you very much for taking the time to put this tutorial and sample application together. I have learned a lot working with it this past week. Your website is so full of useful information. Your efforts are greatly appreciated!
Brian Hudson
Kevin
I keep getting the following message:
Data source RealEstate could not be found.
The error occurred in C:\Inetpub\wwwroot\realestate\components\StateGateway.cfc: line 16
Called from C:\Inetpub\wwwroot\realestate\index.cfm: line 6
Called from C:\Inetpub\wwwroot\realestate\index.cfm: line 1
Called from C:\Inetpub\wwwroot\realestate\components\StateGateway.cfc: line 16
Called from C:\Inetpub\wwwroot\realestate\index.cfm: line 6
Called from C:\Inetpub\wwwroot\realestate\index.cfm: line 1
14 : <cfset var q_state = "" />
15 :
16 : <cfquery name="q_state" datasource="#variables.dsn#" cachedWithin="#CreateTimeSpan(0,2,0,0)#">
17 : SELECT state.*
18 : FROM state
Kevin
jgamma
I'm using CFMX7 Developers edition on my local machine. I've created my own, downloaded apps I know work, copied and pasted you name it and NOTHING using flash remoting works.
I've reinstalled CF twice now and I can not find ANYTHING about flash services gateway in the adminstrator or file structure anywhere.
Where can I look to see if in fact it is installed and if not where can I get it from. I've been a Coldfusion Developer for quite some time but these are my first efforts at Flash Remoting.
Sorry if this is completely stupid but I'm at a loss.
Thanks
jgamma
"The Flash Remoting service URL does not translate to an actual directory structure on your web or application server. The URL, which ends in flashservices/gateway, specifies the web application context and gateway servlet mapping for the Flash Remoting service." http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16319#url
jgammache
myService = connection.getService("remoting.flRemote", responseHandler );
Sorry for all the posts
BFLOPHIL
I get the same results when using the search button. Would anyone have any suggestions?
Thanks
Phil
Micah Knox
Micah
MJE
First, thanks for all of the hard work on this application! It has been absolutely invaluable to me!!
I am encountering one issue with the app itself using MS Access - I receive the following error when attempting any searches: Im getting this error: "Error Executing Database Query." - everything else works.
Second issue is, you know how if you have a regular submit button, all of the messages that you enter in required fields pop up. However, using the type="button" to call the function to submit without refresh doesn't show those messages, although it highlights the required fields. How can I get the messages to display?
Thanks again!
MJE
Has anyone been able to get this to work with Access? I don't have MySQL to see if that is the issue, but when I install this right out of the gate, everything works except for the search functionality. Every time I hit the search button, I get Error Executing Database Query. I desparately need to utilize this search functionality, and trying to troubleshoot this by taking all of the queries out of the listingDAO.cfc didn't work. I see that hte search function calls the listingService.cfc which then in turn calls the listingGateway.cfc, but trying to take out the queries and params to determine where the issue is located hasn't gotten me anywhere.
BTW - what does DAO stand for in the listingDAO.cfc file?
MJE
searchArguments.bathrooms = search_bathrooms.selectedItem.data;
on the index.cfm page, the search worked! I'll have to look a little further to see why that is, but I'm so glad that I finally got it working. One less question of mine to answer :) Again, WONDERFUL job on all that you're doing here!
Laura
When using access, make sure your datasource is using Access with Unicode (as opposed as just Access), otherwise some cfqueryparams don't work.
DAO stands for Data Access Object
:)
MJE
MJE
Quick question (I hope) - I'm having some issues with having the updates, deletions and new item inserts showing up in the datagrid after posting. I've managed to get the creation, search and edit to work (mind you this is not the actual real estate application, but an application that I've been building using this as a reference).
I've been going over and over the code and am not sure what I'm missing. I have the listing grid change function there, but I'm not seeing/understanding the code in the real estate application that updates the listingGrid datagrid when something is added, edited or deleted, but it does work in your example.
Could you please give me a quick pointer as to what I should be paying attention to?
Thanks!
David
You might want to double check your DAO's fetch method. If you don't include all the fields that are in the grid, then they won't show up. I had the same problem because i was using a joined query in my grid and half wouldn't show up because i wasn't querying all the fields in my fetch method after my insert/update. Hope this helps!
David
MJE
I went into the fetch method, and wasn't sure exactly where I should be focusing with regard to including all the fields that are in the listingGrid. I ensured that all of the lines that have <cfset data["mls_id"] = getQuery.mls_id /> for example, all correspond to the items in the listing grid.
Do you mean that all of these cfset data lines should correspond to all of the form fields that are in the cfform in order for the real time updates and additions to reflect in the data grid?
I am able to search successfully - it is just when I make an edit or add a new record. The edit and and addition does take place in the database, it just doesn't show up in the data grid until I manually refresh the page.
David
Whatever fields you have in your grid, your fetch method must contain the same. I don't think that is your problem though now that you mention that when you refresh the grid has the new value. Instead, look in setUpRemoting() and make sure that your onResult, create, update and remove methods are correct. These are what update the grid once your fetch methods send data back to the service. These methods should match those that are in the service followed by _Result. Ex: serviceName_Result. In my case i have a service called createImage so when i want to get the result entered back to my grid i use the responseHandler.createImage_Result in order to have it sent to my grid:
<!--- handle create item response --->
responseHandler.createImage_Result = function( results: Object ):Void {
if (results.status){
imageGrid.addItemAt(0,results.item);
_root.setMode('add');
}
mx.managers.CursorManager.removeBusyCursor();
//show a message
alert(results.message);
}
Hope this helps,
David
Alex
I'm just windering if there is a way to see an error returned by flash form page? Is there any debuging method available for flash forms?
I pretty much disassemble your code and re-created similar application, but there are some weird point I'd like to check and can't see what's happening from CF point of view.
Thanks for any info!
SIMON DONN
now this is where my problem starts
if I alert('mailbox name:' + results[0]); then I get australia which is the mailbox region but how do i replace this statement with one using the dynamic name.
var Australia:mx.controls.DataGrid = Australia;
Australia.dataProvider = results[1];
I've tried everything but nothing works.
i.e
var results[0]:mx.controls.DataGrid = results[0];
results[0].dataProvider etc.
any ideas?
Chris
I've successfully converted this app to my own usage. However, I'm a bit at odds about changing how the ID/Primary Key is implemented, because the realestate app uses a string (MLS_ID) instead of a more typical autonumber.
I've just about caught everything except for the Create functions in ListingService and ListingDAO. Where exactly is the code that re-lists the grid, but uses the newly inserted ID only?
In other words, I don't see a re-query after the Insert SQL, because in the case of the realestate app, the primary key has basically been TYPED by the user as the MLS ID. In my application, the ID is created by the DB (MS Access), so while the app does insert the data, it still comes back with an error since the listing is not showing the newly entered listing.
Scott
I used a default (user friendly) error message inside of the CFCATCH tags and then included a cfmail tag that has all of the error information and data dumps.
Scott
Scott
http://www.macromedia.com/support/flashremoting//ts/documents/iis_gateway_connection.htm
SIMON
Scott
There are three try an catch error handlers on the ListingDAO.cfc file. You can add the cfmail tag inside the <cfcatch></cfcatch> blocks.
EXP:
<cfcatch type="Any">
<cfset returnObj["status"] = false/>
<cfset returnObj["message"] = "Generic error message that you want the user to see"/>
<cfmail to="[email protected]" from="[email protected]" subject="Error">
#CFCATCH.message# : #CFCATCH.detail# <BR />
Then whatever generic message that you want to include. I also include the data dumps.
</cfmail>
</cfcatch>
SIMON
<cfset application.listingGateway = createObject("component",variables.componentPath & ".components.ListingGateway").init(variables.dns) />
Is there a better way of doing this then in the application scope?
great site, keep up the good work!!!
Scott
If so, you can use the cfmail in there.
I also use cfmail tags on my application page for unexpected log-outs.
I am a newbie to actionscript, and I really don't know of a way to use the mail tags inside of the actionscript.
Ray Buechler
I've pretty much got everything working (adding, updating and deleting a record). However two things are not happening, first, a record is created, updated or deleted the grid goes blank. I have to refresh the browser to get the grid data back. Second, there is no status message after a record is added, deleted or updated. The main change I have made is that I am not using the search piece of the Real Estate app. Other than that the actionscript code is straight from the Real Estate app.
Any help would be greatly appreciated.
Ray
Melissa
Thanks.
Laura
There is no fix for that yet.
http://www.forta.com/blog/index.cfm/2006/4/17/ColdFusion-And-IE-Active-Content-Changes
Doug Bedient
Cingular.services.listingService does not have a method "remove" that matches the name and parameters provided.
Here are the chunks of code:
=============================
public function submitRemove():Void {
alert(edit_cing_ID.text); <!---good--->
cingularAdmin.myGlobalObjects.listingService.remove(edit_cing_ID.text);
}
=============================
<cffunction name="remove" access="remote" returntype="struct" output="false" description="Removes a listing">
<cfargument name="cing_ID" required="true" type="numeric" hint="Primary key"/>
<cfset var result = application.listingManager.delete(arguments.cing_ID) />
<!--- item will only contain the id --->
<cfset result["item"] = structnew()/>
<cfset result["item"]["cing_ID"] = arguments.cing_ID />
<cfset result["status"] = javacast("boolean",result["status"]) />
<cfreturn result />
</cffunction>
=============================
<cffunction name="delete" output="false" hint="Deletes a listing" access="public" returntype="struct">
<cfargument name="cing_ID" required="true" type="numeric" hint="Primary key"/>
<cfset var deleteListingQuery = "" />
<cfset var returnObj = structnew() />
<cfset returnObj["status"] = false />
<cfset returnObj["message"] = "" />
<cfset returnObj["cing_ID"] = arguments.cing_ID />
<cftry>
<cfquery name="deleteListingQuery" datasource="#variables.dsn#">
DELETE FROM cingular
WHERE cing_ID = <cfqueryparam value="#arguments.cing_ID#" cfsqltype="cf_sql_integer" maxlength="10"/>
</cfquery>
<cfset returnObj["status"] = true/>
<!--- catch any error that the query may have thrown --->
<cfcatch type="Any">
<cfset returnObj["status"] = false/>
<cfset returnObj["message"] = CFCATCH.message & ": " & CFCATCH.detail />
</cfcatch>
</cftry>
<cfif returnObj["status"]>
<cfset returnObj["message"] = "Listing has been deleted"/>
</cfif>
<cfreturn returnObj/>
</cffunction>
================================
I've been starring at this a long time. I would really appreciate any help.
Thanks,
Doug
Doug Bedient
Your demo:
Doug Bedient
Doug Bedient
Your demo:
Laura
I don't know why your comment got cut. Maybe you tried using a code tag and didn't close it?
Anyway, back to your problem. I've seen that, but I can't recall what was the cause. I would make sure the application scope does not have an old instance of the component you are trying to access. I would also remove the body of the functions in the component and see if any of that fixes it (in the case there is an error there). Just in case, first I would also cast the parameter you send to the remote function as a Number.
I am glad you are using an HTTP analyzer to debug your code. I see a lot of people just working in the dark when it comes to debugging remoting.
Chaz
Thanks
Doug Bedient
www.ieinspector.com/httpanalyzer/
Chaz
Jeremy
works great locally
not so good once uploaded to my host.
search fails when checkboxes are checked. ("Error executing database query")
add / update property fails. ("Error executing database query: unknown types value")
i'm running mysql 5.0.18 on both. any ideas?
thanks,
Jeremy
i've seen some posts regarding this problem
Laura
I would say that your local machine and your host have difference JDBC drivers since it works in one but not the other. The latest drivers usually work better than the old ones.
Chaz
I found away to pop up a window in cfform, but I am having problems with it need some help.
This is the code:
function ErrorPopUpScreen():Void
{
var PopUpWindow = mx.managers.PopUpManager.createPopUp(_root,mx.containers.Window,true);
PopUpWindow.closeButton = true;
_global.ClosePopUpWindowBtnListener = Object();
_global.ClosePopUpWindowBtnListener.click = function(EventObject)
{PopUpWindow.deletePopUp();
};//End of ListenerDataLoaded.modelChanged = function(EventObject)
PopUpWindow.addEventListener("click",_global.ClosePopUpWindowBtnListener);
PopUpWindow.setSize(660,340);
};//End of function ErrorPopUpScreen():Void
the window shows up… it shows up as transparent (even the content is transparent). I can not add a title and if I close the window and reopen it.. the close button moves off to the side of the window.
Can anyone help me with this…
Kelly
I read in the Part 2 article about the fetch function and how "This structure will later be used to poulate the created or updated records in the datagrid." I see how this is working in your sampel app, but I am not seeing where it is called to do that.
Kelly
responseHandler.saveEssEval_Result = function( results: Object ):Void {
var item:Object = results.item;
alert("item length " + item.getLength());
alert("col names " + item.getColumnNames());
alert("ess " + item.ESS_TEXT);
alert("res ess_uuid " + results.ess_uuid);
//find the item's index
alert("index " + index);
var index:Number = _root.findItem(essentialsGrid,'ESS_UUID',results.ess_uuid);
if (results.status && index >= 0) {
essentialsGrid.replaceItemAt(index,item);
alert("Item updated");
}
else {
alert("grid could not be updated");
}
mx.managers.CursorManager.removeBusyCursor();
}
Laura
Almost guaranteed that is a case-sensitivity problem. Check that the keys of your structure match the case of those in your grid column (not what you write as the column name but the case of the column in your query). Note that if you use Oracle all columns are upper case, or at least that is what people have reported.
Boybles
I'm still trying to grasp why in this example you never use cfsavecontent for anything, yet in many examples throughout this site you do. What would be the main impetus for using actionscript contained in cfsavecontent vs. using actionscript contained in the form (<cfformitem type="script">). Additionally, I noticed that your listener (event: modelChanged) examples (knowing when data arrives in grid) never use cfsavecontent. Why is that?
Thanks!!!
Boybles
Laura
If you look carefully, you will notice that all of the examples that use <cfsavecontent> are previous to the release of the CF Updater that added the <cfformitem type="script"> functionality. With the new feature of being able to create your own functions, there is no reason to use <cfsavecontent> and therefore functions should be used instead. See this post: http://www.asfusion.com/blog/entry/filtering-a-grid-as-you-type---using
Kelly
"There is no property with the name 'manageGoals'."
It is failing on my formOnLoad function where I am creating a new object...
manageGoals.myGlobalObjects = {};
Any ideas??
Kelly
Laura
"manageGoals" needs to be the name of your form. If you change the name, you need to update the global variables to use the new name.
Kelly
Kelly
Gilbert
I took it and tried to adapt it for my purpose, a server manager tool. Everything works well except one problem:
I display all my servers in a grid and the user can see the details of the server in a box below the grid. All the bindings work as expected. Once I have done a search to minimize the number of displayed servers in the grid all the bindings work okay but not the checkboxes.
For example the binding is done like this:
<cfinput type="checkbox" name="serv_hosted" label="hosted" value="{listingGrid.selectedItem.serv_hosted=='true'}"/>
The problem is that nothing is selected even if the checkbox is checked inside the grid !
Can someone please help me as I am totally clueless waht happens here.
Thanks
Stace
Or is there anouther angle of attack to take with this?
Thanks All
Dan
Is there a way to update these text items when an item is updated, added or deleted from the grid, which holds the vacation log? Do I have to put these values into cfinput fields?
Thanks for any advice and the sample app.
Dan
Dan
Dan
James McArdle
requiredfieldname.parent.indicator_mc._alpha=0;
</cfsavecontent>
Above is the solution to the astericks of doom problem. feel free to email me if you have any questions. enjoy everyone!
Laura
There are examples for checkboxes in the article, although those work when the grid does not show the checkboxes. It looks like this:
<cfinput type="checkbox" name="edit_hasPool" value="{(listingGrid.selectedItem!=undefined)?listingGrid.selectedItem.hasPool:false}" label="Pool"/>
Also note that there are bugs when that grid column is editable as noted in this post: http://www.asfusion.com/blog/entry/binding-checkboxes-in-flash-forms
Stace,
To clear the value use: myTextInput.text = ''
Steve Walker
Dan Fredericks
I can't seem to put together the data using actionscript from the select box.
<cfselect enabled="yes" name="Schedule" multiple="yes" size="5" width="95" label="">
<!--- <option value="select">Schedule</option> --->
<cfoutput>
<cfloop query="schedules">
<option value="#scheduleID#">#schedule#</option>
</cfloop>
</cfoutput>
</cfselect>
actionscript:(in a cfsavecontent tag)
I have flash remoting code, but need to pass the values from the above select list.
any help?
Thanks
Alan
Excellent tutorial.I came across some of the problems mentioned above and resolved them and managed to resolve them to RealEstate App to run.
I then tried to create my own application based on the tutorial I get the following error when I click my search button:-
Error: Element DOCUMENTGATEWAY is undefined in a Java object of type class [Ljava.lang.String; reference as...
I have defined within the application.cfc the following..
<cfset application.documentGateway = createObject("component",variables.componentPath & ".components.DocumentGateway").init(variables.dns) />
Any ideas?
Alan
I've resolved previous comment - restarted CF.
thanks
Alan
Laura
I would put the createUUID() in the create function of the ListingDAO before making the insert query. Then, when you return, set the returnObj["mls_id"] with the newly generated id.
Dan,
You have to loop over the selectedIndices of the List (cfselect) and send that to the cfc in some form you choose (you can create an array with ids, a list, etc), but you have to make your cfc accept that array, list, etc.
Dan Rouw
Thanks for any advice you have.
Dan
<!--- handle update response - This code does not update the grid. The value of results.gridName is 'AugPTO' --->
responseHandler.updatePTO_Result = function ( results:Object):Void {
if (results.status) {
var item:Object = results.item;
alert(results.gridName);
var grid:mx.controls.DataGrid = results.gridName;
var index:Number = _root.findItem(grid,'PTOID',results.PTOID);
grid.replaceItemAt(index,item);
}
mx.managers.CursorManager.removeBusyCursor();
alert(results.message);
}
<!--- handle update response - This code does update the grid. AugPTO is the name of the grid for August. --->
responseHandler.updatePTO_Result = function ( results:Object):Void {
if (results.status) {
var item:Object = results.item;
var index:Number = _root.findItem(AugPTO,'PTOID',results.PTOID);
AugPTO.replaceItemAt(index,item);
}
mx.managers.CursorManager.removeBusyCursor();
alert(results.message);
}
Dan Rouw
Here is the code that works. If no one has any suggestions for improvement I'll leave it as is.
Thanks,
Dan
<!--- handle update response --->
responseHandler.updatePTO_Result = function ( results:Object):Void {
if (results.status) {
var item:Object = results.item;
switch (results.gridName) {
case "JanPTO" :
var grid:mx.controls.DataGrid = JanPTO;
break;
case "FebPTO" :
var grid:mx.controls.DataGrid = FebPTO;
break;
case "MarPTO" :
var grid:mx.controls.DataGrid = MarPTO;
break;
case "AprPTO" :
var grid:mx.controls.DataGrid = AprPTO;
break;
case "MayPTO" :
var grid:mx.controls.DataGrid = MayPTO;
break;
case "JunPTO" :
var grid:mx.controls.DataGrid = JunPTO;
break;
case "JulPTO" :
var grid:mx.controls.DataGrid = JulPTO;
break;
case "AugPTO" :
var grid:mx.controls.DataGrid = AugPTO;
break;
case "SepPTO" :
var grid:mx.controls.DataGrid = SepPTO;
break;
case "OctPTO" :
var grid:mx.controls.DataGrid = OctPTO;
break;
case "NovPTO" :
var grid:mx.controls.DataGrid = NovPTO;
break;
case "DecPTO" :
var grid:mx.controls.DataGrid = DecPTO;
break;
default :
var grid:mx.controls.DataGrid = JunPTO;
}
var index:Number = _root.findItem(grid,'PTOID',results.PTOID);
grid.replaceItemAt(index,item);
}
mx.managers.CursorManager.removeBusyCursor();
alert(results.message);
}
Steve Walker
Thanks. The UUID is generated and inserted into the database without any problems, but then the fetch function throws an error saying that the data being sent is not of the type UUID. If I change it to type=string it works except the fetched record is blank and I have to refresh the form in order to see the new record. Any ideas?
Sam
Can anyone help me on how to implement the records maintenance following this example using autonumber as the primary key.
6dust
Code:
<cfform onLoad="doneLoading();" height="400" width="350" format="flash" method="post" name="jakarta_form1" style="background-color: ##398A8E; color: black; theme-color: ##4CB2B8;">
<cfformitem type="script">
var jakartaService:mx.remoting.NetServiceProxy;
function doneLoading()
{
setRepeat();
setupJakartaService();
}
function setRepeat()
{
_global.myInterval = setInterval( repeatedCheck, 5000 );
_global.myCounter=0;
}
function repeatedCheck()
{
_global.myCounter++;
jakartaService.getTimeStruct();
}
function setupJakartaService()
{
var connection:mx.remoting.Connection = mx.remoting.NetServices.createGatewayConnection("http://<cfoutput>#cgi.HTTP_HOST#</cfoutput>/flashservices/gateway/");
var responseHandler:Object = {};
responseHandler.getTimeStruct_Result = function( results: Object ):Void {
alert(results.DATE_STRING);
}
responseHandler.onStatus = function( status: Object ):Void {
//if there is any error, show an alert
alert("Error: " + status.description);
mx.managers.CursorManager.removeBusyCursor();
}
jakartaService = connection.getService("Jakarta.backend", responseHandler );
}
function onSubmitClick()
{
progressBar.visible = true;
progressText.text = "Submitting request...";
jakartaService.getTimeStruct();
}
</cfformitem>
If I click the button that calls onSubmitClick(), the remoting call runs fine and I get a string alerted to me, as it should be. However, the call via setInterval never executes. The _global.myCounter variable gets incremented, so I know that portion is working...
Any thoughts would be greatly appreciated!
Thanks,
6dust
thomary
Can anyone help us on how to implement the records maintenance following this example using autoincrement as the primary key.
6dust
Mine was a scoping issue; just figured it out. I changed it from this:
_global.myInterval = setInterval( repeatedCheck, 5000 );
to this:
_global.myInterval = setInterval( this, "repeatedCheck", 5000 );
and now it works fine.
aubry
I m trying to make a cf application based on the realestate sample but when I try to update, remove or insert new data I've this error message :
Error : CF adapters : Service form.services.ListingService does not have a method "updateRoomok" that matches the name and parameters provided.
Please, help mee I' going crazy about this
thanks !!!
ps : if someone want to help me I can sent him my files
Rob
I constructed a small search box, that fills a grid - and that works great.
I'm trying to show phone numbers for the selected person from the grid, and thought a repeater would work well for this.
When someone clicks on an item in my grid, it does a flash remote query to pull back all the telephone numbers a person has (voice, fax, mobile etc).
I get the query back, but can't figure out how to get the repeater to change to show the results.
I've got a handler setup, and it executes when my data comes back, and I've tried to do something like this:
q1.dataProvider = results;
q1 being the query holding the telephone numbers. This does not give me any error, but the repeater does not update.
What am I missing?
xavy
Excellent tutorial. I was able to do get most of the functionlity working for my app. I have one problem though - I am not able to see the changes in the grid after an update - the reason being the code is not able to get the index of the row updated:
responseHandler.update_Result = function( results: Object ):Void {
var item:Object = results.item;
var index:Number = _root.findItem(listingGrid,'mls_id',item.mls_id);
Here if I check the item.mls_id, I do see the ID that was upadted, but the findItem returns nothing and hence the grid does not get updated - everything else works just fine. Any idea what I am doing wrong? Any help will be greatly appreciated.
Regards,
Xavy
Laura
Use the name of the repeater instead of the name of the query to set the results of the remoting call.
xavy,
I am not sure what the problem can be, but I would check the case of the column names.
Stacy
I have a text field in my form that is for a dollar amount. the dollar amount can be from .01 up to 4999.99. The problem I'm having, is that it will accept a number such as 20.023546, which isn't valid. I was able to put a similar number into the real estate app when adding a new property for the price.
How can I do an actionscript validation that will look at this, see there are more than 2 digits after the decimal and then drop them? (I don't want it to round the number)
Any tips are appreciated!! :)
Stacy
Guess I hadn't had enough coffee yet this morning! :)
AuroraCF
Does any body know how I can fix or code it correctly with incremental record to table?
Here is my scenario:
I read new record from tblRecNumber for new entry. Once the record insert to table I then update the tblRecNumber +1. This work ok with my other forms, for this flash form, its hold the tblRecNumber and use it over, and over again on second and third entry. Are there any way I can tell it to read new value from my tblRecNumber?
Steve
If I try to create a text type search input box like below:
searchArguments.Lot = search_Lot.text;
<cfinput name="search_Lot" type="text" />
I get an error message if the input box field is left blank. The error states that the value of the input passed to the query is not of type NUMERIC. Which means the entire search box will not work unless you enter a Lot number, which may or may not be known by the user of the search form.
How do you set up the query so that it ignores the input of the Lot input box if it is NOT an INTEGER? The code below does not work:
<cfargument name="Lot" required="false" type="numeric" default="0" hint="Lot number"/>
<cfif len(arguments.Lot)>
AND listing.Lot = <cfqueryparam value="#Lot#" cfsqltype="CF_SQL_INTEGER"/>
</cfif>
I tried changing the Lot column type in MySQL to VARCHAR(3), but when I do that the Lot numbers will not list in numerical order in a datagrid. Instead of 500 being the last record in ascending order, 99 becomes the last record since it is looking at the numbers as strings and not integers.
I tried to create a cfinput search box for bedrooms (which is a smallint column) using the tutorial database, and that doesn't work either. Initially these queries would only error if the cfinput box was left blank (or if there was more than one cfinput box, if any of them were left blank), now even if I enter a valid integer into the box or boxes, it does not return a search result at all.. This is very frustrating! I'm trying to make a very simple search form that searches either by text input of Lot number or MLS number and nothing else, and cannot get it to work properly :(
Also I don't understand how to write a query that may not have any inputs submitted to it. Say if there were only 2 cfinput text boxes, and the user didn't input anything and just hit the submit button. To make it so that no error would result. Any help would be appreciated!
Daniel
The following codes are to make sure the selected date in the calendar is not the future date. Anyone has ideas? Thanks in advance.
<cfsavecontent variable="CheckDate1">
var todayDate = new Date(myForm.todayYear, myForm.todayMonth - 1, myForm.todayDate, 0, 0, 0, 0);
var selectedDate = new Date(
myForm.select_date1.substr(6, 4),
myForm.select_date1.substr(0, 2) - 1,
myForm.select_date1.substr(3, 2),
0, 0, 0, 0
);
alert("Today's Date in the cfsavecontent:\n" + todayDate + "\n\n" +
"Seleced Date in the cfsavecontent:\n" + selectedDate);
if (selectedDate > todayDate)
alert("You cannot select a date greater than today's date");
else
alert("You are ok.");
</cfsavecontent>
<cfform name="myForm" format="Flash">
<cfformitem type="script">
function CheckDate2():Void
{
var todayDate = Date(myForm.todayYear, myForm.todayMonth - 1, myForm.todayDate, 0, 0, 0, 0);
var selectedDate = Date(
myForm.select_date2.substr(6, 4),
myForm.select_date2.substr(0, 2) - 1,
myForm.select_date2.substr(3, 2),
0, 0, 0, 0
);
alert("Today's Date in the cfformitem:\n" + todayDate + "\n\n" +
"Seleced Date in the cfformitem:\n" + selectedDate);
if (selectedDate > todayDate)
alert("You cannot select a date greater than today's date");
else
alert("You are ok.");
}
</cfformitem>
<cfcalendar name="select_date1" height="150" width="310" onchange="#CheckDate1#">
<cfcalendar name="select_date2" height="150" width="310" onchange="CheckDate2()">
<cfinput type="text" name="todayYear" value="#DateFormat(Now(), 'yyyy')#" label="todayYear">
<cfinput type="text" name="todayMonth" value="#DateFormat(Now(), 'm')#" label="todayMonth">
<cfinput type="text" name="todayDate" value="#DateFormat(Now(), 'd')#" label="todayDate">
</cfform>
Chuck
Those that have this 'variable' doesn't exist in CFC or method/argument match. Variable names must match exactly, unlike passing variables from one CF function/method to another, the names of variables are only relevant to the inside function, but in remoting they must match letter for letter. If you pass method(edit_field.text), you must have inside the CFC, <cfargument name="edit_field.text" as the name of the argument. Try instead var MyRecordID:Number = edit_field.text, then call your method(MyRecordID), and derefrence it in the CFC <cfargument name="MyRecordID"...
Instead, I have found that passing values as an object better/easier, and then using the ARGUMENTS scope to 'capture' the passed object and reference the variables in that matter handy.
IE...
var MyObj:Object = {};
MyObj.MyRecordID = edit_field.text;
formname.path.method(MyObj);
inside CFC method()...
use ARGUMENTS.MyRecordID...
For testing purposes though, you need to have a <cfagrument name="args" type="struct" required="false">
Then I have ...
<cfset var copy = StructNew()>
<cfif IsDefined("ARGUMENTS.args")>
<cfset copy = ARGUMENTS.args>
<cfelse>
<cfset copy = ARGUMENTS>
</cfif>
And then use copy as the parameter to the component CFC's. I can then use a test.cfm to test a create,update,etc and pass a struct for it to work.
This program is great for seeing what is going on between your Flash APP and the Server: http://www.kevinlangdon.com/serviceCapture/
Hope this helps others, I've run into these myself.
Lesley
Does anyone know what causes this?
Please help!
Lesley
when my data displays in the cfgrid, either the data is blank (nothing when there should be something) or the word NULL is in the field.
Does anyone know what causes this?
Please help!
Natalie
ash
My cods is
<cfselect name="state" label="STATE" multiple="yes" width="80">
<option value>VIC</option>
<option value>NSW</option>
<option value>QLD</option>
<option value>WA</option>
<option value>ACT</option>
<option value>SA</option>
</cfselect>
Please help
Robert Hammond
I have been trying to deploy the real estate sample app on CF8 J2EE on tomcat 6.0. The GUI works fine, and remoting is also working fine but data is not able to be fetched from the database and data can not be inserted into the database either.
I tried the dateResponder code and it worked fine, meaning that flashremoting is working well. Initially, i thought the problem was with tomcat so I tried CF8 J2EE on blazeDS but the problem was still the same. Then i tried to deploy Coldfusion 8 on Oracle's Standalone OC4J from Orion and the problem was still the same. I have built an application to deploy on the web using CF8 deployed as J2EE on Tomcat 6.0 so i please need your help on this. All I need to know is that, is this a known issue or is there a workaround to get the data to be fetched and inserted, updated and deleted from the database in the J2EE Configuration.
Thanks for the Help.
manu
I'm facing an issue while accessing flsh forms on websphere.I have deployed coldfusion 8 developer edition on websphere[WAS] 6.1.All normal cfm pages are working fine but when trying to load any simple flash form ,i'm getting the following error "Error 500: flex.server.j2ee.cache.CacheFilter (initialization failure)".Any advice to resolve this issue would be greatly appreciated.