Status/Resolution/Reason: Closed/Won't Fix/LowImpact
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 10/14/2010
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 0
Problem:
[ANeff]
Bug for: cfc bind expression format requires access="remote".
Please note the following:-
CF9.0.1 added CF Ajax support for CFCs outside the webroot
CF9 added onCFCRequest(), which allows access="public" methods to be accessed remotely
However, currently there is a bug which hinders the combination of the above 2 features.
The bug is related to this bind format: "cfc:componentPath.functionName(parameters)", when used in HTML cfgrid's bind & onChange attributes.
Currently, CF throws a CFCFunctionNotRemoteException, if functionName refers to a method that is not access="remote". However, no error is thrown when using "url:URL?parameters" format, and pointing to same CFC and passing same parameters.
Fixing this bug will allow CF Ajax to support access="public" (or access="private") when using onMissingMethod methods in CFCs above webroot.
Method:
Please note that the 1st grid works (uses url bind format), while the 2nd grid throws error (uses cf bind format). Both reference the same CFC, are handled by onCFCRequest(), and pass the same parameters.
---------------Application.cfc---------------
<cfcomponent output="no">
<cfscript>
THIS.name = "TestOncfcrequestRemotePublic";
</cfscript>
<cffunction name="onCFCRequest" access="public" returntype="void" output="yes">
<cfargument name="component" type="string" required="yes" />
<cfargument name="methodName" type="string" required="yes" />
<cfargument name="methodArguments" type="struct" required="yes" />
<cfscript>
//writelog("in onCFCRequest()");
var myCFC = new "#ARGUMENTS.component#"()[ARGUMENTS.methodName];
writeOutput(serializeJSON(myCFC(argumentCollection=ARGUMENTS.methodArguments)));
</cfscript>
</cffunction>
</cfcomponent>
---------MyCFC.cfc---------
component output="false"
{
public struct function getGridData(numeric gridPage, numeric gridPageSize, string gridSortColumn, string gridSortDirection) output="false"
{
var myQuery = queryNew("myString", "varchar");
queryAddRow(myQuery);
myQuery.myString = "my string";
return queryConvertForGrid(myQuery, ARGUMENTS.gridPage, ARGUMENTS.gridPageSize);
}
public void function setGridData(string gridAction, struct gridRow, struct gridChanged) output="false" {}
}
---------index.cfm---------
<cfform name="myForm1">
<cfgrid
format="html"
name="myGrid"
selectmode="edit"
bind="url:./MyCFC.cfc?method=getGridData&gridPage={cfgridpage}&gridPageSize={cfgridpagesize}&gridSortColumn={cfgridsortcolumn}&gridSortDirection={cfgridsortdirection}"
onChange="url:./MyCFC.cfc?method=setGridData&gridAction={cfgridaction}&gridRow={cfgridrow}&gridChanged={cfgridchanged})">
<cfgridcolumn name="myString" header="my string" />
</cfgrid>
</cfform>
<cfform name="myForm2">
<cfgrid
format="html"
name="myGrid"
selectmode="edit"
onChange="cfc:MyCFC.setGridData({cfgridaction},{cfgridrow},{cfgridchanged})"
bind="cfc:MyCFC.getGridData({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">
<cfgridcolumn name="myString" header="my string" />
</cfgrid>
</cfform>
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3042464
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email: 3D1D17B03C844EBF992001AC
External Test Config: 10/14/2010
Attachments:
Comments: