complex data type as opposed to a multiref.
How do I return a CFC instead of returning a Struct? The method within my
CFC looks like below, what do I need to change in order to return it correctly:
<cffunction name="returnStruct" access="remote"
returntype="struct" hint="Test method to return an Associative Array or
Structure">
<cfargument name="rows" type="numeric">
<cfset var mystruct=StructNew()>
<cfset mystruct.fname="Bob">
<cfset mystruct.lname="Jones">
<cfset mystruct.Address="505 55 Water Street">
<cfreturn mystruct>
</cffunction>
Brook
P.S Can I return a query as a key in the struct without issue?
At 02:33 PM 10/21/2003, Matt Liotta wrote:
>If returning a structure isn't working I would suggest returning a CFC
>instead. For example, suppose you had the following structure.
>
><cfscript>
>foo = StructNew();
>foo.bar = "something";
>foo.foobar = "something else";
></cfscript>
>
>You could replace the above with the following CFC.
>
><cfcomponent>
><cfproperty name="bar" type="string">
><cfproperty name="foobar" type="string">
><cfscript>
>bar = "something";
>foobar = "something else";
></cfscript>
></cfcomponent>
>
>By returning the above CFC instead of a structure, CFMX will create
>WSDL that defines a complex type with keys of a type defined by the
>CFProperty tags.
>
>Matt Liotta
>President & CEO
>Montara Software, Inc.
><http://www.MontaraSoftware.com>http://www.MontaraSoftware.com
>(888) 408-0900 x901
>
>----------
>[
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

