Hi Clint,
Thanks for your reply. I think i was not clear ealrier
on my problem. Here's a sample code I am dealing with.
Please note the property 'modarray' of the 'pData'
object.
'modarray' is populated with SelTP object _s whcih is
an Array of Structures. Here I polupate the _s with
selectedIndices of a data gris I am using.
The required parameter 'MODARRAY' not passed to the
function! is the message I get following my
RemoteObject call
Any idea what I am missing here.
SelTP.as
----------
class SelTP {
var tp : Array;
function SelTP() {
tp=new Array();
}
function addItem(item : Object,index: Number) :
Void {
index=index==null?0:index;
tp.addItemAt(index, {ID: item.TPID, DE:
item.DES});
}
function getItemCount() : Number {
return tp.length;
}
}
======================
MXML
-------
<mx:Script>
<![CDATA[
import SelTP;
var _s:Object;
var myModel: Object;
var updRes:String;
function fn_buildObj():Void {
_s = new SelTP();
for(var
v:Number=0;v<grd_tp.selectedIndices.length;v++){
_s.addItem(myModel[grd_tp.selectedIndices[v]],_s.getItemCount());
}
return _s;
}
function fn_repData():Void{
var pData:Object = new Object();
pData.modarray = fn_buildObj();
rob_gD.fn_updData(pData);
}
]]>
</mx:Script>
<mx:RemoteObject id="rob_gD"
endpoint="http://127.0.0.1:8500/flashservices/gateway"
source="MetricportalNew.reus.components.GetNm"
showBusyCursor="true">
<mx:method name="fn_getEmpDets"
result="myModel=event.result" />
<mx:method name="fn_updData"
result="updRes=event.result" />
</mx:RemoteObject>
=================
CFC
------
<cffunction name="fn_updData" returntype="string"
access="remote" >
<cfargument name="modarray" Type="any"
required="true" >
<cfset var v = "Bad data">
<cfif IsArray("modarray")>
<cfset v = "Array">
<cfelseif IsObject("modarray")>
<cfset v = "Object">
<cfelseif IsStruct("modarray")>
<cfset v = "Struct">
</cfif>
<cfreturn v>
</cffunction>
--- Clint Tredway <[EMAIL PROTECTED]> wrote:
> function sendToCF(){
> var send = new Object();
> send.param1 = "hello";
> send.param2 = " world";
> your_svc.sayHello(send);
> }
>
> this will show up in the Flash scope inside CF as
> #flash.param1# and
> #flash.param2#..
>
> This is a simple example but it should help you...
> if not I would be
> happy to try and help you figure out what you
> need...
>
> HTH,
> Clint
>
>
> On Wed, 23 Mar 2005 17:41:11 -0800 (PST), Mohanraj
> Jayaraman
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi All,
> >
> > I've been trying to pass an AS Object to a
> Coldfusion
> > CFC thorough FLEX RemoteObject calls. But I havent
> > found any success so far.
> >
> > I knew there are examples provided my Macromedia
> for
> > exchanging complex objects
> >
>
(http://www.macromedia.com/devnet/flex/articles/complex_data_03.html)
> > , but they are explained with Java which I am not
> able
> > to reproduce the same with Coldfusion CFC's.
> >
> > Have anybody tried this before? If so,can you
> explain
> > it with a simple example?
> >
> > Thanks,
> > Mohanraj
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Make Yahoo! your home page
> > http://www.yahoo.com/r/hs
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
>
>
> --
> My Blog
> http://www.clinttredway.com
>
> Are you diabetic?
> http://www.diabetesforums.com
>
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/