To bind your CFC values to your form fields, you should have a local model that is going to hold your returned values (or default ones) and can be used as a source for binding. I've gotten in the habit of creating a AS class model that accepts the returned values from my RO call which has public properties that can be bound to the form fields - and vice versa. When I wish to update/insert the information in my database, it is then only necessary to pass my model as an object to a delegate class which does my updating for me.
Jeff -----Original Message----- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy Rottman Sent: Friday, July 29, 2005 1:46 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: flex with coldfusion cfc's Humm I could have sworn I attached this last time. But here is my cfc. <!-- ################################# # HS System # #Written by: Jeremy Rottman # #Updated: 07/28/2005 # ################################# --> <!-- - Coldfusion MX 6.1, any platform w/ the MetaWrapper.class installed to the class path - Bluedragon? not sure - Coldfusion MX 7.0 any platform --> <!-- Abstract Data Acess --> <cfcomponent displayname="tbl_agentPortal_admin_logsDAO for MySQL" hint="I abstract data access for tbl_agentPortal_admin_logs." extends="tbl_agentPortal_admin_logsDAO" > <cffunction name="create" access="public" returntype="void" output="false" hint="CRUD Method."> <!-- Object from which a record is created --> <cfargument name="tbl_agentPortal_admin_logsBean" type="tbl_agentPortal_admin_logs" required="true" /> <cfset var tbl_agentPortal_admin_logsInsert = 0 /> <cfset var tbl_agentPortal_admin_logsmaxcols = 0 /> <cftransaction> <!-- Insert query --> <cfquery name="tbl_agentPortal_admin_logsInsert" datasource="#variables.dsn#"> INSERT INTO tbl_agentPortal_admin_logs ( fld_admin_log_new, fld_admin_log_review, fld_admin_log_adds, fld_admin_log_tp_closing, fld_admin_log_qb_closing ) VALUES ( <cfqueryparam cfsqltype="cf_sql_VARCHAR" value="#arguments.tbl_agentPortal_admin_logsBean.getfld_admin_log_new()# " maxlength="#arguments.tbl_agentPortal_admin_logsBean.getBeanConfigValue( 'fld_admin_log_new).maxlength#" null="#arguments.tbl_agentPortal_admin_logs.isNullfld_admin_log_new()#" /> , <cfqueryparam cfsqltype="cf_sql_VARCHAR" value="#arguments.tbl_agentPortal_admin_logsBean.getfld_admin_log_review ()#" maxlength="#arguments.tbl_agentPortal_admin_logsBean.getBeanConfigValue( 'fld_admin_log_review).maxlength#" null="#arguments.tbl_agentPortal_admin_logs.isNullfld_admin_log_review() #" /> , <cfqueryparam cfsqltype="cf_sql_VARCHAR" value="#arguments.tbl_agentPortal_admin_logsBean.getfld_admin_log_adds() #" maxlength="#arguments.tbl_agentPortal_admin_logsBean.getBeanConfigValue( 'fld_admin_log_adds).maxlength#" null="#arguments.tbl_agentPortal_admin_logs.isNullfld_admin_log_adds()#" /> , <cfqueryparam cfsqltype="cf_sql_VARCHAR" value="#arguments.tbl_agentPortal_admin_logsBean.getfld_admin_log_tp_clo sing()#" maxlength="#arguments.tbl_agentPortal_admin_logsBean.getBeanConfigValue( 'fld_admin_log_tp_closing).maxlength#" null="#arguments.tbl_agentPortal_admin_logs.isNullfld_admin_log_tp_closi ng()#" /> , <cfqueryparam cfsqltype="cf_sql_VARCHAR" value="#arguments.tbl_agentPortal_admin_logsBean.getfld_admin_log_qb_clo sing()#" maxlength="#arguments.tbl_agentPortal_admin_logsBean.getBeanConfigValue( 'fld_admin_log_qb_closing).maxlength#" null="#arguments.tbl_agentPortal_admin_logs.isNullfld_admin_log_qb_closi ng()#" /> ) </cfquery> <!-- Selection Query --> <cfquery name="tbl_agentPortal_admin_logsmaxcols" datasource="#variables.dsn#"> select max(fld_admin_log_id) as maxfld_admin_log_id from tbl_agentPortal_admin_logs </cfquery> <cfset arguments.tbl_agentPortal_admin_logsBean.setfld_admin_log_id(tbl_agentPo rtal_admin_logsmaxcols.maxfld_admin_log_id, false, false)/> </cftransaction> </cffunction> </cfcomponent> --- In flexcoders@yahoogroups.com, Tariq Ahmed <[EMAIL PROTECTED]> wrote: > Hi Jeremy, I didn't see a CFC attached. But in general you define an > <mx:RemoteObject>, and in a really basic sense: > > ##jeremy.mxml > <mx:Application init="myRO.getSomething().send()"> > <mx:RemoteObject id="myRO" > endpoint="@ContextRoot()/flashservices/gateway" source="jeremy"> > <mx:method name="getSomething" result="newAdds.text=event.result"/> > </mx:RemoteObject> > > <mx:FormItem label="New Additions"> > <mx:TextInput id="newAdds" /> > </mx:FormItem> > </mx:Form> > > </mx:Application> > > ### jeremy.cfc > <cfcomponent> > <cffunction name="getSomething" returnType="string" access="remote"> > <cfreturn "yo!"> > </cffunction> > </cfcomponent> > > Check out these articles: > http://www.richinternet.de/blog/index.cfm?entry=831FE26E-0D70-9C2D-2549E 1D1978CF1B0 > http://www.bpurcell.org/blog/index.cfm?mode=entry&entry=1013 > http://www.bpurcell.org/blog/index.cfm?mode=entry&entry=1019 > http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19356 > http://coldfusion.sys-con.com/read/47443.htm > > > > Jeremy Rottman wrote: > > >I am still working with flex and my database structure. The question > >I have at hand is this. I have a coldfusion cfc that I have written, > >and would like to use it as my remote object. Right now I am still in > >the process of learning to bind the data from my cfc to my flex app. > >So here my my question. with the cfc I have pasted below. How would I > >bind the data from the called RO to form fields. > > > >So if I wanted fld_admin_log_new (from the cfc below) to be bound to the > >form field new adds. What would be the code to call the cfc and hte > >code to bind the cfc to that form field. > > <mx:Form> > > > > <mx:FormItem label="New Additions"> > > <mx:TextInput id="newAdds" /> > > </mx:FormItem> > > </mx:Form> > > > > > > -- 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 ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hg0tmaj/M=362335.6886445.7839731.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1122653138/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</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/