all groups > coldfusion flash integration > february 2007 >
You're in the

coldfusion flash integration

group:

Coldfusion and FLEX


Coldfusion and FLEX kruse
2/14/2007 12:00:00 AM
coldfusion flash integration:
Hi,

I have got the following VO in flex:
package com.adobe.cairngorm.samples.store.vo
{
import com.adobe.cairngorm.vo.IValueObject;

[RemoteClass(alias="com.adobe.cairngorm.samples.store.vo.ProductVO")]
[Bindable]
public class ProductVO implements IValueObject
{
public var id : Number;
public var name : String;
}
}

How do I Create an object in Coldfusion that I can store into this Flex object
like this

var test : ProductVO = event.result;

Any one that have done this??
Re: Coldfusion and FLEX PaulH **AdobeCommunityExpert**
2/14/2007 12:00:00 AM
[quoted text, click to view]

i guess this might be one way (maybe add some getters & setters):

<cfcomponent name="productVO" hint="some useful info goes here" output="false">
<cfproperty name="id" type="numeric">
<cfproperty name="name" type="string">

<cfparam name="id" type="numeric" default="-99">
<cfparam name="name" type="string" default="">

<!--- from mike nimer --->
<cffunction name="init" access="public" returntype="MapInfo">
<cfscript>
var key="";
for (key in arguments) {
this[key] = arguments[key];
}
return this;
</cfscript>
</cffunction>
</cfcomponent>


<cfscript>
// snippet from another CFC that fills that object & returns to flex
var products=ArrayNew(1);
product=createObject("component","productVO").init(
id=1,
name="Dr. Who"
)
arrayAppend(products,product);
return products
</cfscript>

or suppose you could try returning a cfquery as well.
AddThis Social Bookmark Button