Title: Message
I have my local model instantiated via MXML and I bind the public properties to corresponding property of the form elements. Form has its individual element properties mapped to the model.
 
Here's a snippet:

<model:AdminUserModel id="user"
 adminUserID="{_recordID}"
 strFirstName="{strFirstName.text}"
 strLastName="{strLastName.text}"
 strEmailAddress="{strEmailAddress.text}"
 strPassword="{strPassword.text}"
 strPosition="{strPosition.text}"
 strPosition2="{strPosition2.text}"
 strCompanyName="{strCompanyName.text}"
 strAddress="{strAddress.text}"
 strAddress2="{strAddress2.text}"
 strPostalCode="{strPostalCode.text}"
 strCity="{strCity.text}"
 strProvince="{strProvince.text}"
 strPhone="{strPhone.text}"
 strFax="{strFax.text}"
 intPrimaryRoleID="{intPrimaryRoleID.selectedItem.data}"
 bitTempPasswordFlag="{bitTempPasswordFlag.selected}"
 chrStateAbbr="{chrStateAbbr.selectedItem.data}"/>
 
Jeff
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mehdi, Agha
Sent: Friday, July 29, 2005 12:01 PM
To: [email protected]
Subject: RE: [flexcoders] Re: flex with coldfusion cfc's

Jeff,

How do you handle two-way binding in that case?

Agha Mehdi
IDT - eBusiness Program Manager


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Battershall, Jeff
Sent: Friday, July 29, 2005 7:03 AM
To: [email protected]
Subject: RE: [flexcoders] Re: flex with coldfusion cfc's

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: [email protected] [mailto:[email protected]] On
Behalf Of Jeremy Rottman
Sent: Friday, July 29, 2005 1:46 AM
To: [email protected]
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 [email protected], 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="">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/
 




--
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




Reply via email to