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

coldfusion flash integration : getURL in Flash Form


Mark Forsberg
3/6/2007 5:04:42 PM
I'm trying to use getURL to pass a value to another template. I'm having no
luck. the URL variable cfgridkey is "undefined".

<cfsavecontent variable="getRecord">
getURL('comment.cfm?cfgridkey=' +
searchResults.dataProvider[searchResults.selectedIndex]['COMMENT_KEY'],'_self');

</cfsavecontent>

<cfgrid format="flash" name="searchResults" colheaderfontsize="10"
colheaderalign="center" colheaderbold="yes" height="210" onchange="#getRecord#">
<cfgridcolumn name="comment_key" header="Comment ID" dataalign="center"/ >
<cfgridcolumn name="lastname" header="Last Name"/>
<cfgridcolumn name="firstname" header="First Name"/>
<cfgridcolumn name="comment_date" header="Comment Date"
dataalign="center"/>
<cfgridcolumn name="comment" header="Comment Preview" width="400"/>
</cfgrid>

The grid is being populated with remoting. Would that make any difference as
to whether the dataProvider can be viewed by the application?
Thanks.

The ScareCrow
3/6/2007 10:35:03 PM
I'm fairly sure that as is case sensative, so

COMMENT_KEY is not the same as comment_key

Mark Forsberg
3/6/2007 11:01:23 PM
Scarecrow,

I changed the COMMENT_KEY to comment_key and it is still undefined.
comment_key works fine in populating the grid with the remote. I thought that
comment_key would also be the proper case for using the cfgrid value in a url.
I appreciate the help in this. It's got me stumped.

Mark
The ScareCrow
3/7/2007 2:48:04 AM
I would say the problem has to be that the value is not being added to the url.

Is there a reason your still using cfsavecontent ?

To debug, I would do the following:

1. Put in an
Alert(searchResults.dataProvider[searchResults.selectedIndex]['COMMENT_KEY'])
To see if the value is being returned

2. Put in a hard coded value and see if this works
Let's assume a valid comment_key is "search", then
getURL('comment.cfm?cfgridkey=' + 'search';

How are you trying to access the value in the comment.cfm page ?
I think by default it is URL.cfgridkey
You can also include the attribute of "post" or "url" in the geturl function
call.

On reading the doc's about geturl, I can't see anything about a default value.
So I would suggest putting it in


getURL('comment.cfm?cfgridkey=' +
searchResults.dataProvider[searchResults.selectedIndex]['COMMENT_KEY'],'_self',
'GET');

Ken



Mark Forsberg
3/8/2007 9:51:49 PM
Scarecrow,

I ran numerous tests like you suggested. For grins I populated the grid
with a cfquery and I was able to attach the index in the getURL function. When
I populate the grid with remoting it's as though the function called by the
button click cannot see the grid. I thought that by declaring the name of the
grid in my remoting call that it would be recognized as _root. Perhaps not.
For now it's just going to run like an html form. Not what I want but
I've got other things to finish.
Thanks for all of your help.

Mark F.
The ScareCrow
3/8/2007 10:10:50 PM
Instead of the following
searchResults.dataProvider[searchResults.selectedIndex]['COMMENT_KEY']

Try

searchResults.selectedIndex.comment_key

mcadle
3/27/2007 6:12:02 PM
Your problem is you are not passing all of the items into your grid with
remoting. You need to use this:

responseHandler.onResult = function( results: Object ):Void {
data.dataProvider = results._items;
}

This should solve your problem. You can use either method to bind to the
selected item in the grid and pass it in the getURL clause.
Mark Forsberg
4/3/2007 6:25:00 PM
mcadle,

Sorry for the slow response. It's been hectic.
I'll give this a try and see how it goes.
Everyone, thanks for the help. Remoting is cool, but I haven't done it
enough to get good at debugging.
Again, thanks.

Mark
AddThis Social Bookmark Button