ahh ok,
Thanks Dirk.
On 8/20/05, Dirk Eismann <[EMAIL PROTECTED]> wrote:
> AS 2.0 style getter/setters are not supported when doing RemoteObject
> invokations, you'll have to use simple public fields instead. The instances
> you retrieve really are instances of your InvoiceVO class, the getter is just
> not working.
>
> to check, simply try this inside the onResult method
> mx.controls.Alert.show("Is InvoiceVO: " + (event.result[0] instanceof
> InvoiceVO));
>
> So - as long as you set up your mappings with Object.registerClass() then
> you'll be dealing with typed objects. just get rid of the getters/setters and
> you should be back on the track!
>
> Cheers,
> Dirk.
>
> ________________________________
>
> Von: [email protected] im Auftrag von Scott Barnes
> Gesendet: Fr 19.08.2005 16:45
> An: [email protected]
> Betreff: Re: [flexcoders] Re: Query Cleansing
>
>
>
> On 8/19/05, Dirk Eismann <[EMAIL PROTECTED]> wrote:
> > Sorry, but i don't get what you're doing in your CFC - why do you
> > instantiate the com.inco.finance.ITW.Invoice component? You're not using it
> > afterwards, do you?
>
> oops disregard, left over code chunk (sleep deprived).
>
> > Also, passing back a CF Array of ASObject instances maps to an AS Array of
> > typed AS classes so I don't know why you still need this extra work.
>
> Not entirely true (well from what i've seen so far heh and did i
> mention sleep deprived?). It maps to a plain object, one thats not
> type specific
>
> eg:
> inside the InvoiceVO lets say there is a function like this:
>
> function get label() : String
> {
> mx.core.Application.alert("I'm properly defined");
> return invoiceid;
> }
>
> Then I were to return an Array of ASObjects via coldfusion and tried
> this without final cleansing.
>
> var tmpLabel = event.result[0].label; // Nothing would happen and in
> this case, undefined.
>
> Then if i were to do this:
>
> var tmpVO : InvoiceVO = event.result[0];
> var tmpLabel = tmpVO.label;
>
> It works? (i'm too tired to figure out why or how but it does).
>
> Now granted, further in the application if i were to then pass each
> indx of that array into other object.methods it would effectively
> match up the vo to that one stated via cfmx
>
> eg:
>
> view.getInvoiceAt(indx:Number) : InvoiceVO {
> return view.dataprovider[indx];
> }
>
>
>
>
>
>
> > Dirk.
> >
> > -----Original Message-----
> > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
> > Scott Barnes
> > Sent: Friday, August 19, 2005 3:17 PM
> > To: [email protected]
> > Subject: Re: [flexcoders] Re: Query Cleansing
> >
> > Q. I've found that when I return an Array of Objects, i still need to a
> > final "cleanse" so to speak flex-side. In that, by giving a type it then
> > maps accordingly. If i leave out the re-packing of the result, it treats
> > them as simple objects that aren't typed.
> >
> >
> > --- Command ----------------------------------------
> >
> > public function onResult( event : Object ) : Void
> > {
> > var invoiceVO : InvoiceVO;
> > var aResults : Array = new Array();
> > for(var i=0; i < event.result.length; i++) {
> > invoiceVO = event.result[i];
> > aResults.push(invoiceVO);
> > }
> > ModelLocator.wfs_init = 6;
> > ModelLocator.dp_inbox = aResults;
> > }
> >
> > --- CFC ----------------------------------------
> > <cfloop query="qInvoices">
> > <cfscript>
> > EmptyInvoiceVO =
> > createObject("component","com.inco.finance.ITW.Invoice").init();
> >
> > EmptyInvoiceVO.initFromQuery(qInvoices,currentRow);
> >
> > ASObject =
> > createObject("java","flashgateway.io.ASObject");
> > InvoiceVO = ASObject.init();
> >
> > InvoiceVO.setType("com.incoFLEX.ITW.vo.InvoiceVO");
> > InvoiceVO.put("invoiceid", invoiceID );
> > InvoiceVO.put("company", "scott");
> > ArrayAppend(aResults, InvoiceVO);
> > </cfscript>
> >
> > </cfloop>
> >
> >
> > On 8/19/05, Scott Barnes <[EMAIL PROTECTED]> wrote:
> > > I feel so dumb, i've totally overlooked flashgateway.io.ASObject
> > >
> > > Thanks Dirk,
> > >
> > > (i've got pretty much the exact setup as you described, only array of
> > > objects now has unlocked a lot more "aahhhh...i'm such a n00bie")
> > >
> > > Scott
> > > p.s
> > > thanks andrew too ;) hehe.
> > >
> > > On 8/19/05, Andrew Spaulding <[EMAIL PROTECTED]> wrote:
> > > > Hey Scott,
> > > >
> > > > I had to deal with a similar scenario a while ago and posted a
> > > > solution on flexdaddy
> > > >
> > > > http://www.flexdaddy.info/2005/06/16/strongly-type-a-cf-return-using
> > > > -cairngorm/
> > > >
> > > > Let me know if that is what you're kinda after ;-)
> > > >
> > > > Cheers,
> > > >
> > > > Andrew Spaulding
> > > > www.flexdaddy.info
> > > >
> > > >
> > > >
> > > > --- In [email protected], Scott Barnes <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > I've come across a small annoyance (easily fixed) but one that
> > > > > kind of triggered an initial "extra" level of development.
> > > > >
> > > > > Basically I went down the path of returning a query from a CFC to
> > > > > FLEX. Nothing overly exciting about that. Except the property
> > > > > "character casing" popped its ugly head up the moment I switch my
> > > > > SELECT xyz to SELETC xYZ.
> > > > >
> > > > > Suddenly a basic Datagrid i was using appeared blank.
> > > > >
> > > > > I've since stopped that, and basically "cleanses" the
> > > > > dataproviders via my commands..
> > > > > ie:
> > > > > onResult = iterate over the queryset, create an array of VO per
> > > > > queryRow while forcing each initial property key to be uppercase..
> > > > >
> > > > > basically its a "cleansing" procedure before storing that data for
> > > > > re-use through out my views / shared dataproviders etc.
> > > > >
> > > > > Has anyone else done this? what techniques have been implemented?
> > > > > as its quite annoying to have mixed results from CFMX to FLEX in
> > > > > terms of data (especially when querys and structs are concerned).
> > > > >
> > > > > What are some best practices in terms of using Remote Object /
> > > > > Recordsets with frameworks like Cairngorm (which i'm presently
> > > > > using)
> > > > >
> > > > > --
> > > > > Regards,
> > > > > Scott Barnes
> > > > > http://www.mossyblog.com
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Flexcoders Mailing List
> > > > FAQ:
> > > > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > > Search Archives:
> > > > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Regards,
> > > Scott Barnes
> > > http://www.mossyblog.com
> > >
> >
> >
> > --
> > Regards,
> > Scott Barnes
> > http://www.mossyblog.com
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> --
> Regards,
> Scott Barnes
> http://www.mossyblog.com
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
--
Regards,
Scott Barnes
http://www.mossyblog.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12hnnuhls/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124496563/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
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/