我使用Flex的ColdFusion方法调用RemoteObject cfc方法。
<fx:Declarations>
<s:RemoteObject destination="ColdFusion" source="cfc.categoryGateway" id="categoryGateway">
<s:method name="getCategoryList" result="returnHandler(event)"
fault="mx.controls.Alert.show(event.fault.faultString)">
<s:arguments>
<orderby>categoryId</orderby>
<parentCategory>1</parentCategory>
</s:arguments>
</s:method>
</s:RemoteObject>
</fx:Declarations>当我的cfc以下列方式接受参数时:
<cffunction name="getCategoryList" access="remote" output="false" returntype="query">
<cfargument name="parentCategory" type="string" required="false" />
<cfargument name="orderby" type="string" required="false" />
<!--- code... --->
<cfreturn qCategoryList />
</cffunction>因此,您可以看到,在调用cfc方法时,我更改了参数的顺序。但它不起作用。
这意味着<s:arguments>不传递名为的参数。有什么解决办法吗?正如您所看到的,我可能有一些非强制性的参数,因此必须以名称传递。
发布于 2010-12-07 21:04:07
参数是一个数组,所以不管您将每个元素命名为什么,我认为它仍然会按顺序使用它。你可以试着做这样的事情:
<s:RemoteObject destination="ColdFusion" source="cfc.categoryGateway" id="categoryGateway">
<s:method name="getCategoryList" result="returnHandler(event)"
fault="mx.controls.Alert.show(event.fault.faultString)" />
</s:RemoteObject>然后打电话:
categoryGateway.getCategoryList({orderby:'categoryId', parentCategory:'1'});https://stackoverflow.com/questions/4373524
复制相似问题