ColdFusion Flash Forms Macromedia Developer Center article
We are happy to announce that the first part of a series of two articles, "The Real Estate Sample Application - Part 1: Building the Search Functionality", has been published at the Macromedia Developer Center. It's a walk through a Flash Forms sample application that uses Flash Remoting. You can view it running here. Before anyone asks, this is the almost-finished application, so it contains features not explained in the article and downloadable code. You will need to wait until the second part for that.
As always, you are welcomed to comment about it or ask any question here.
The Real Estate Sample Application – Part 1: Building the Search Functionality
Michael E. Walker II
Jason
Got few questions here but I think I will wait till you post the part II.
Thanks for the great post
Michael
You amaze us everytime with the flashforms!
João Fernandes
CFForms are great but you make them look even better.
George
Holly
JB
Jason
How is it possible to have a more dynamic amenities.
For example if the amenities which are in a comma-delimited list instead of separate boolean field, how could we handle such list field in flash form?
An example for this will be excellent!
Damon Cooper
Damon
Phil
Neil Bailey
I have a question I hope you can help me out with. I have begun playing with drag-and-drop in cf flash form - and I have gotten it working, based HEAVILY on your mxna reader example. Thanks!
However, I a trying to identify the SOURCE of the drag operation, and cannot for the life of me identify how to do it (can it be done within the doDragDropDG function???).
I have read the documentatione extensively, and thought I was onto something with the dragSource object, but alas.......
Can you (or anyone else) help me out??
Thanks,
nb
David Brannan
WayneG
I get it to work if I submit the whole flash form, so I know my cfc code works if I send it a struct. with the form array as per the var dump.
What is the actionscript code to loop over a grid with say two columns only and have the array similiar to the form dump array?
Please I really cant get this to work in weeks! I really would appreciate your help
WayneG
Thank so much for all the inspiration this blog has given us all...
WayneG
Please find the code I have finally managed to get working
function confirmClick():Void{
var timesheetConfirmation:mx.controls.DataGrid = timesheetConfirmation;
var args:Array = [];
for(var i:Number = 0; i < timesheetConfirmation.length; i++){
var item:Array = [];
item.intTimesheetID = timesheetConfirmation.dataProvider[i].intTimesheetID;
item.bitIsCaptured = timesheetConfirmation.dataProvider[i].bitIsCaptured;
item.bitIsConfirmed = timesheetConfirmation.dataProvider[i].bitIsConfirmed;
item.intLogUser = intLogUser.text;
args.push(item);
}
_global.confirmation(args);
}
the args then go to via facade.cfm to cfc which is then giving me the following error:
You have attempted to dereference a scalar variable of type class java.util.ArrayList as a structure with members.
I am looping the cffunction, with a cfargument set as type="array" name="args"
This is where I need help please..
Brook
And have it actually be used? I've made changes to the file, added traces, etc, but it doesn't make any difference?
How the heck can I modif that file and have the changes work?
Any Ideas?
Kunal Anand
Luis Puesan
"
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. "
Neil Bailey
You need to install the coldufion updater, and bring your server up to...I think its 7.01.
This will solve your issue, and make your life a LOT easier when building dynamic cfforms in the future.
You're looking for help in the right spot, however - these guys are mad scientists when it comes to this stuff, and I haven't seen a question posed yet that they can't answer...
Jorge Tejada
ez
Melissa
<cfformitem type="script">
#include "a_flash_form.as"
</cfformitem>.
When I do this, my form does not load. Should all of my script be in the .as file? I am calling a function for onLoad to set up the remoting.
Thanks.
Paul
Josh Rodgers
Luis Alvarez
Ray Buechler
markuz
David
david
PS - Love the site!
Dan
I just need to clear something up in my head. Am I correct in saying that you don't need the following code in setUpRemoting()?
var myService:mx.remoting.NetServiceProxy;
It doesn't get called anywhere else. The service is in this tutorial is instantiated by:
RealEstateAdmin.myGlobalObjects.listingsService = connection.getService( ... );
Does creating a cfc with access="remote" extend NetServiceProxy?
Steven Ross
Sort of the same way you built this app but imagine the bottom edit box changes based on your selection on the left. Is that possible in flash forms?
Michael Steele
Anthony
Any insight would be great.
Judah
Great article, Thanks!
Laura
The schedule for part 2 is end of November. So you'll have to wait a few more days :-)
Ray,
Yes, we have plans to make this app in Flex 2.
Dan,
> var myService:mx.remoting.NetServiceProxy;
> It doesn't get called anywhere else
You are right, that line of code is not necessary and it should be removed.
Anthony,
> What if I want the connection more reusable?
> Can I tell inside the onResult function which method
> is returning the data?
You will see in part 2 that we do reuse the same connection for calls to other functions on the same component. Basically, you need to add other functions to the handler: responseHandler.myFunction_Result. You can read about that at http://www.asfusion.com/blog/entry/introduction-to-flash-remoting
Steven Ross
Laura
You can show a swf or a jpg in a cfform. That means you can then show charts or Flash Paper in a cfform.
Check this post:
http://ray.camdenfamily.com/index.cfm/2005/8/11/Flash-Forms-and-Flash-Paper
John
Laura
Since you brought the parent query with remoting, it makes sense to get that sub-query with remoting as well. It would be like the search, but you would call a different function, say getPictures(), and pass a parameter like the mls_id to get the list of pictures for that particular house.
John
Luis Alvarez
I'm a newbie to remoting and cf7 forms.
I've used your realestate app as a model for something I'm working on and it's been very helpful, thank you. Your article in CFDJ on data binding was great also. I'm ready for the next step. I understand Part 2 was supposed to be available at the end of Nov. Meanwhile I know how to bind the results from the grid to a detail form via bind="{}, but I don't understand how you can bind to a field that is not in the results grid. Is there a way of binding to the results of the query directly. I know this will be covered in part two, but can you give me an idea?
On another note I heard you guys will be in Seatle speaking on the integration of cf7 & flex, wish I could be there. Our company has just bought cf7 enterprise and is planning to use another copy for our production servers next year. Should we hold off and go with flex2, as we're considering RIAs for our apps, instead of investing in CF enterprise?
Gracias,
Luis
D
stephenwightman
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 :
Laura
You still need CF for server-side development. It shouldn't be a choice between CF and Flex, they serve different purposes. If you are considering RIAs, I would strongly recommend to use Flex for the front-end and CF for the other stuff.
stephen,
You need the CF Updater.
Dave
Line: 61
Char: 1
Error: 'lc_id' is undefined
Code: 0
URL: http://192.168.200.162/realestate
Hope you can tell me what I did wrong. Thanks
Mike
Error executing database query
Parameter ?_19 has no default value
Any ideas
Ashley
Thanks,
Ashley
Andreas Reichert
info [Flash Remoting MX]->java.io.FileNotFoundException
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:79)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invokeNext(JRunRequestDispatcher.java:534)
at jrun.servlet.JRunNamedDispatcher.include(JRunNamedDispatcher.java:91)
at flashgateway.adapter.java.ServletAdapter.invokeFunction(ServletAdapter.java:79)
at flashgateway.filter.AdapterFilter.invoke(AdapterFilter.java:266)
at flashgateway.filter.SecurityFilter.invoke(SecurityFilter.java:85)
at flashgateway.filter.LicenseFilter.invoke(LicenseFilter.java:58)
at flashgateway.filter.ErrorFilter.invoke(ErrorFilter.java:44)
at flashgateway.filter.LogFilter.invoke(LogFilter.java:43)
at flashgateway.filter.BatchProcessFilter.invoke(BatchProcessFilter.java:63)
at flashgateway.filter.DebugFilter.invoke(DebugFilter.java:38)
at flashgateway.filter.SerializationFilter.invoke(SerializationFilter.java:59)
at flashgateway.Gateway.invoke(Gateway.java:194)
at flashgateway.controller.GatewayServlet.service(GatewayServlet.java:56)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:259)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
and form is returning something like "service not found".
Does anyone know, what's wrong with it? My first thought was, that the component is not found, but it's hard to debug without any realizable error-Output
David
I had the same problem for a while. In my case, i had the issue where my gateway or dao objects were not being created, so it generated the same error because it couldn't find anything in memory. You most likely have to change your application.cfc's component path variable to match what your current folder system is. Hope this helps!
David
David
An easy way to flush your application is to use applicationtimeout. I use mine like so:
this.applicationTimeout=CreateTimeSpan(0,24,0,0);
If i'm testing locally i'd probably change it to
this.applicationTimeout=CreateTimeSpan(0,0,0,1);
that way the application will timeout after a second , and restart when i close my browser.
Hope this helps!
David
Andreas Reichert
no change at all - in my opinion it is a configuration problem with the flashgateway. But i can not find any documentation about it.
Andreas Reichert
Josh Swenson
Joshua Swenson
Neil
I have no idea how you're creating dynamic forms w/out it...
Sandra
Hi,
Is there any way to populate the grid using flash remoting w/o using the search function, or w/o having the user to press a button to populate the grid?
I just want the users to select an item in the grid and then populate the forms so that they can edit, add and delete records from the DB.
Thanks.
Laura
Check this post:
http://www.asfusion.com/blog/entry/knowing-when-the-cfform-data-arrives
However, there is no need to load data manually with remoting if you just want to have it there to edit.
The search was just a simple example to show how remoting works.
Sandra
Now I'm running into another problem when deleting a record, I'm getting this error message "Element ROLE_ID is undefined in arguments".... in the tutorial the function delete only requires the id of the record to remove, but my program requires two ids to delete the record.
Heres is my code:
This is from the component that handles the delete:
<cffunction name="remove" output="false" hint="Deletes a property listing" access="public" returntype="string">
<cfargument name="user_ID" required="false" type="string" hint="user_ID"/>
<cfargument name="role_ID" required="false" type="string" hint="role_ID"/>
<cfargument name="name" required="false" type="string" hint="ID"/>
<cfset var deleteListingQuery = "" />
<cfquery name="deleteListingQuery" datasource="hs_sql2">
DELETE FROM dbo.Employee_Roles
WHERE dbo.Employee_Roles.user_ID = <cfqueryparam value="#arguments.user_ID#"/>
AND dbo.Employee_Roles.role_ID= <cfqueryparam value="#arguments.role_ID#"/>
</cfquery>
<cfreturn arguments.role_ID />
</cffunction>
and this is from the flash remoting service component:
<cffunction name="remove" access="remote" returntype="struct" output="false" description="Removes a listing">
<cfargument name="user_ID" required="false" type="string" hint="user_ID"/>
<cfargument name="role_ID" required="false" type="string" hint="role_ID"/>
<cfargument name="name" required="false" type="string" hint="ID"/>
<cfset var remoteLog = createObject("component", "sandra.er.flashRemoting")/>
<cfset var result = structnew()/>
<cfset remoteLog.remove(argumentCollection=arguments)/>
<cfset result["status"] = javacast("boolean", true)/>
<cfreturn result/>
</cffunction>
and this is my response handler:
responseHandler.remove_Result = function( results: Object ):Void {
if (results.status){
username.removeItemAt(_root.findItem(username,'user_ID',results.item.user_ID));
username.removeItemAt(_root.findItem(username,'role_ID',results.item.role_ID));
_root.setMode('add');
alert("Record has been removed");
}
else {
alert ("Record could not be removed");
mx.managers.CursorManager.removeBusyCursor();
}
}
what am I doing wrong?? =((
I'd really appreciate your help.
Laura
You are not showing the important part, where you call the remoting function :)
The error is telling you you are not sending all the necessary parameters. When you call your service now it looks something like this:
myService.remove(user_ID);
you need to add the role to the function call:
myService.remove(user_ID, role_ID);
Also, you don't need to do this twice:
username.removeItemAt(_root.findItem(username,'user_ID',results.item.user_ID));
but you will have to modify the findItem function to be able to find items based on 2 ids, not only 1. To simplify things you could replace it with
username.removeItemAt(username.selectedIndex); (it may not always work if the user changes selection before the remoting call gets back)
Steve Walker
This is going to seem like a silly question, but is there a way to pull back the number of records returned once the search is completed (RecordCount)?
Laura
When the results are returned you can check for results.length ("results" or the name of your parameter)
Steve Walker
Thank you for the quick reply. This is where my inexperience shows. Can I show it to the user each time they run a search? I am not sure how to reference it.
Steve Walker
Steve Walker
I found the answer to the previous question concerning displaying the record count. If anyone else is curious, the way to dynamically disply the number of records found in a grid similar to this app the syntax is:
_root.MyTextBox.text = results.items.length;
I placed it inside the remoting function and it works flawlessly. Thanks to Todd Sharp's database app (cfsilent.com)
Steve Walker
I can't wait to see your new blog engine.
Laura
Regarding your first question, you could do that by changing the selected item like this (you should check for bounds)
myGrid.selectedIndex++;
Regarding your second question, of course it is possible. You can do whatever you want in the server, it doesn't have to be a query that you return. The client side does not have to change if you pass the same parameters. Now, what you do what with the excel file is another story.
Steve Walker
Thank you for the answer. It never occurred to me to simply put double plus signs.
Xerrano
I like to know if someone can explain why I can't make work this line of code in my application.cfc...
<cfset application.listingGateway = createObject("component","cfc.ListingGateway").init(application.dsn_properties) />
URL to CFC:
/cfc/ListingGateway.cfc
I try to use it like this:
<cfreturn application.listingGateway.search(argumentCollection=arguments) />
This is the error I get:
Error: Element LISTINGGATEWAY is undefined in a Java object of type class [Ljava.lang.String; reference as...
BUT WHEN I CALL THE ListingGateway.cfc directly without using the ListingServices.cfc component works ok.
Any ideas... Looks like the createObject is not working, correct?
Thanks.
Xerrano
Laura
Have you tried refreshing the app (changing the name of the application, restarting cf, etc)? Why don't you make a dump of the application <cfdump var="#application#"> in a regular cfm file to see if the component is there?
Jimmy
First I want to say this an awesome application you created. I'm kinda stuck on a problem. I took your example and was able to create something similar to your. I'm at the point where I have 2 date field, and a cfselect.
The user select a date range and then from the select they have 2 option Male/Female. When the user clicks the search button it SHOULD go and query my DB and display all the birthday in the Date Range and the gender selected in my CFGRID. The problem is I don't know where to start with this. Do I create a function that accepts the 3 fields and return a result stored in CFGRID using an OnClick()? I noticed you're using CFC on your example, I'm still learning flash remoting and all, and got lost on how you did it on your example. Can some please help me out on this?
Thanks,
Jimmy
Laura
If you ask me where to start, I would tell you to read the article and try the code we show as it explains how to do the search step by step, what you need on the form, what you need on the server, etc. You can also read part 2 if you need to update the data in the datagrid.
Paul
Paul
Thanks
Tony Eckert
Something I am curious though is if it's possible to search for just part of MLS ID and then the grid would display all entries which contain that string in it. Example, if you cannot remember the full MLS ID number, but know that it ends with a 78, I would like to type in 78 into the search and have all entries with the string 78 in them to display in the grid. I'm sure there is a way, but I'm pretty new at remote forms and haven't had any luck on google for this answer. Any help would be appreciated.
Laura
That would need a simple change in the query. Instead of doing:
listing.mls_id = <cfqueryparam value="#mls_id#" cfsqltype="CF_SQL_VARCHAR"/>
You would do:
listing.mls_id LIKE <cfqueryparam value="%#mls_id#%" cfsqltype="CF_SQL_VARCHAR"/>
Tony Eckert
Tony Eckert
I have taken things a step further by adding an additional column in the database, ItemID, which acts as a unique identifier for each MLS_ID entry. So, if you wish to update the MLS_ID, you simply point the update to WHERE ItemID = #arguments.ItemID#.
I have ItemID set up as an AutoNumber in the DB, using increment numbers, so every new entry I make the ItemID number increases by 1. I've run into one small problem though. Ever since I made the ItemID an autonumber with increment, I get a blank entry in the CFGrid after adding a new item, rather than seeing the item I just added. If I click the "search" button on the search panel, my entry appears. So, is there something about autonumbers that doesn't get updated imediately upon submitting a new entry?
Laura
The problem is not the autonumber per se, it would be the same if you used any other string/number, etc.
The problem is that since you are creating a new id, you must return that id to the grid. See the structure that we return when creating or updating a result. In that structure, you must include the id you created, with the key name being the same as the column name in your grid.
I am not sure if you also see the other columns as blank, if so, then check that the structure keys are the same as your column names.
Tony Eckert
The DAO contains the create function as you know. Inside this I am setting the returnObj["ItemID"] = arguments.ItemID -- Of course, arguments.ItemID should be empty because we haven't entered input for it, nor do we want to because it's an incremented autonumber. The result of this will return a blank line in the cfgrid since the entity is null/empty.
So, what can I do to set the returnObj ItemID to the new ItemID? This is where my problem sleeps.
Tony Eckert
I found a work-around.
For the fetch function:
<cfset var getlistingQuery = ""/>
<cfset var data = structnew() />
<cfquery datasource="blahblahblah" name="lastID">
SELECT MAX(ItemID) AS cID
FROM table_name
</cfquery>
<cfquery name="getlistingQuery" datasource="#variables.dsn#">
SELECT *
FROM table_name
WHERE ItemID =
<cfqueryparam value="#lastID.cID#" cfsqltype="cf_sql_integer" maxlength="10"/>
</cfquery>
and for the create function:
<cfquery datasource="blahblahblah" name="countemID">
SELECT MAX(ItemID) AS cID
FROM table_name
</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"] = "Item has been inserted"/>
<cfoutput>
<cfset returnObj["ItemID"] = #countemID.cID#>
</cfoutput>
</cfif>
<cfreturn returnObj/>
Only problem is I had to create another fetch command to take care of the update function.
If you've got a better way of doing things, please let me know. thanks!
Laura
Your code is fine. You just don't need to change the fetch function. I suppose your fetch function takes the ItemID as an argument. Since now your create function returns the newly created id, you can use the same fetch function fetch(result.ItemID)
herbert
i want to adopt your great realesate sample and have some "beginner" questions:
1)
how can i show the grid with some initial settings from the search-form? i.e the status sold is selected
2)
in your example - if i make some selections (active, footage ..) the search options switch back to the initial form values after a search, except the pulldown values.
is it possible to keep the selected search options?
and how?
kind regards
herbert
Xerrano
Is there a chance you can help me to achieve this:
I like to use more than one table in my database to include real estate agencies and relate any property to any agency using agency_ID.
this is my listingGateway cfquery right now, but is not working.
<cfset var listingQuery = "" />
<cfquery name="listingQuery" datasource="#application.dsn_properties#">
SELECT mlvnet_properties.*
FROM mlvnet_properties
WHERE mlvnet_properties.property_price >= <cfqueryparam value="#arguments.priceFrom#" cfsqltype="CF_SQL_MONEY"/>
<cfif arguments.priceTo GT 0>
AND mlvnet_properties.property_price <= <cfqueryparam value="#arguments.priceTo#" cfsqltype="CF_SQL_MONEY"/>
</cfif>
-- some code removed --
<cfif len(arguments.mls_id)>
AND mlvnet_properties.property_ID = <cfqueryparam value="#mls_id#" cfsqltype="CF_SQL_VARCHAR"/>
</cfif>
<cfif len(arguments.keywords)>
AND mlvnet_properties.property_keywords = <cfqueryparam value="#keywords#" cfsqltype="CF_SQL_VARCHAR"/>
</cfif>
<cfif len(arguments.agency)>
UNION
SELECT mlvnet_agencies.*
FROM mlvnet_agencies
WHERE mlvnet_properties.agency_ID = mlvnet_agencies.agency_ID AND mlvnet_agencies.agency_name = <cfqueryparam value="#agency#" cfsqltype="CF_SQL_VARCHAR"/>
</cfif>
<cfif len(arguments.locations)>
UNION
SELECT mlvnet_locations.*
FROM mlvnet_locations
WHERE mlvnet_properties.location_ID = mlvnet_locations.location_ID AND mlvnet_locations.location_name = <cfqueryparam value="#locations#" cfsqltype="CF_SQL_VARCHAR"/>
</cfif>
ORDER BY mlvnet_properties.property_price DESC
Any ideas?
Thanks
Felipe Serrano
xerrano
Can anyone show me how to query from more than just one table?
I tryed to do it, and this is what happen: I set up only two realestate-properties in my porperties table using agency_ID's 1 and 2 and about 40 property offices. When I make a search with no options selected every property appeaer 40 times. But When I try a new search mixing some options, either the first or the second property appear (the way it should)...
Any ideas?
Thanks
Lesley
Laura
1) The search panel only contain simple controls. You can set any default you want depending of what type of control they are. For example, if you want to have a default for a dropdown, use the "selected" attribute, for a text input, use its "value" attribute, etc). See the CF docs for the other controls.
2) That happens because we call "resetForm()" when the search results are received. We did that to avoid other issues and to make things simpler. If you remove that, the search criteria will stay.
Felipe,
You obvioulsy have a SQL problem, which I can't resolve for you. I think you should try your queries in a simple cfm file until you get the expected resulst. By the way, you probably want to use JOIN instead of UNION, but I don't really know what you want to do or what your db schema looks like. (Check an SQL book to see how to make a query that involves more than one table)
Lesley,
Like Felipe, that is a SQL question (at least in the context of the article). Depending on your db, searches are either case sensitive or not. Check your db's syntax and defaults.
Paul
Justin
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
xerrano
Has anyone apply a function to upload images?
my app would have an option to upload up to 10 pictures, does anyone may help out on how to embed the upload image function?
Thanks
Lesley
Laura
Does your server have the CFIDE directory there or as a virtual directory?
Lesley
Lesley
What else should I look for? I really need some help since out IT department is not allowed to help me.
Does anyone else have any suggestions?
Thanks in advance
Lesley Schulz
Laura
Try copying the entire CFIDE folder (from your local copy) to the root of your domain. You can omit the administrator folder, you don't need that.
Lesley
Execution Times
Total Time Avg. Time Count Template
11031 ms 11031 ms 1 D:\CFusionMX\wwwroot\MHC\index.cfm
3047 ms 3047 ms 1 CFC[ E:\inetpub\wwwroot\MHC\components\search.cfc | list() ] from E:\inetpub\wwwroot\MHC\components\search.cfc
0 ms 0 ms 1 D:\CFusionMX\wwwroot\MHC\Application.cfm
203 ms STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN
11234 ms TOTAL EXECUTION TIME
red = over 250 ms average execution time
I copied the CFIDE folder to the server and removed the administrator folder. Any other suggestions?
Lesley
Please help! I am very desperate!
Michael
This is a great application and I've been working to try to modify it to work for an application I'm building.
The search works wonderfully and I've finally got the updates to work, but I'm having problems with the grid updating when the I submit the update.
When I click submit, the grid goes blank and there is no alert message that the item was updated. I have to run the search again to populate the grid, which shows the updated item.
My fuctions are basically the same code as yours except for name changes.
Here is the code that handles the update respone:
<!--- handle update response --->
responseHandler.update_Result = function( results: Object ):Void {
var item:Object = results.item;
//find the item's index
var index:Number = _root.findItem(ActionGrid,'ACT_NUM',item.ACT_NUM);
if (results.status && index >= 0){
ActionGrid.replaceItemAt(index,item);
}
mx.managers.CursorManager.removeBusyCursor();
<!--- show a message --->
alert(results.message);
}
Helper Function to find item in datagrid:
<!--- helper function to find an item in a datagrid --->
public function findItem(grid:mx.controls.DataGrid, columnToSearch:String, id:String):Number {
for (var i = 0; i < grid.dataProvider.length; i++){
if (grid.getItemAt(i)[columnToSearch] == id){
return i;
}
}
<!--- not found --->
return -1;
}
My fetch function is written the same as yours other than the names of the fields and such.
Is there something I'm missing or something somewhere else in the code I need to look at?
Any help you could provide would be wonderful.
Thanks again so much for this example. Once I get this working this will help speed up our loging system greatly.
Felipe Serrano
Now the search results loads into the CFGRID, is there a way to take those results outside the cfform below into a <divs> formated CFLOOP instead the CFGRID, Keeping the the no-refresh feature?
THANKS
Mike Collins
Regarding
[Flash Remoting MX]->java.io.FileNotFoundException
I have found new servers added with Enterprise Manager will find the flashgateway.ear while the cfusion server does not deploy it. So simply renaming the flashgateway.ear will get around this issue.
Thanks,
Mike
Chris Dauw
I have a quick question that I was wondering if someone could help me with.
Lets say you wanted to add an indicator to the edit form that flags records where the "Date Listed" was older than 90 days. How would you go about doing that?
I imagine you would have to add a function to the listingGridChanged() code that would do a date comparison between the value of the date listed field for the row selected and the current date. The only problem is I havent been able to find any documentation detailing how to do this in Action Script that works within CF. Any ideas?
Thanks in advance,
Chris
Ram
I am running into the same problem that was posted here, but unfortunately have not been able to resolve. I am getting the error "Element LISTINGGATEWAY is undefined in Java Object of type class [LJava.lang.String] referenced as etc.."
I tried changing the Application name, but that doesnt help.
Urgently needs tips on how to resolve this...
Thanks,
-Ram
Howard
gaurav khanna
I have copied CFIDE and tried creating virtual directory but flash forms still have issues.
Do flash forms only work in the default website??
fred
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.
Casey McLaughlin
I've kept the code as close to the example as possible. Could someone throw me a bone on a solution here?
I've tried this on both CF 7.01 and 8.01 with the same results.
<!--- handle search by default onResult function --->
responseHandler.onResult = function( results: Object ):Void
{
listingGrid.dataProvider = results;
listingGrid.selectedIndex = undefined;
alert(listingGrid.length);
mx.managers.CursorManager.removeBusyCursor();
}
<cfgrid name="listingGrid" rowheaders="false">
<cfgridcolumn name="Sample" header="Sample"/>
</cfgrid>
Laura
That is usually a problem of case sensitivity. Make sure you define your columns with the right case.
Casey McLaughlin
THANKS
ravi
ravi
I have the same issue as Michael. I click submit and the top row of the grid goes blank. It doesn't show the newly inserted record. But, when I click search it brings the newly inserted record. Could you please help where is the mistake? TX.
Lois
<cfset GrdHeight = (qryLOBContact.recordcount * 20) + 20 >
<cfset FormName = "#LOB_ID#ContactSet"><cfdump var="#FormName#">
<span class="normal"><Cfoutput>#qryLOBContact.LOB_Name#</cfoutput></span><br />
<cfform format="flash" action="?Act=upd" name="Contactlist" skin="haloBlue" accessible="true" height="#FrmHeight#" width="935">
<cfgrid name="#FormName#" format="flash" query="qryLOBContact" height="#GrdHeight#" colheaderbold="true" colheadertextcolor="##067ab4" >