In the save_result function,the Event object has the ID returned by the CFC’s save method.  Do an Alert.show( ObjectUtil.toString(event) ) for the “save_result” method ResultEvent arg.  Right now the method that we generate for you returns nothing “void”.

 

 

                                    private function save_result(event:ResultEvent):void

                                    {

                                                this.dispatchEvent( new Event("change") );

                                                Alert.show( ObjectUtil.toString(event) );

                                    }

 


From: [email protected] [mailto:[email protected]] On Behalf Of g8torjoe
Sent: Tuesday, May 30, 2006 11:28 AM
To: [email protected]
Subject: [flexcoders] Re: Question on CF components created by the Flex Wizard

 

Hi Bill,

I apologize that I haven't quite got this figured out yet...but I am
on the cusp!!!  Here is my confusion laid out in a step by step
explanation:

1) I used the wizard to create an Active Record CFC for my table.  (I
assume that the Bean, DAO setup will yield similiar results but I may
be wrong about that.)  This created 3 files: parts.as, parts.cfc,
partsGateway.cfc.

2) I created a Remote Object that accesses the "save" function of the
partsGateway.cfc component.

3) I believe that the save function then calls the parts.cfc component
and writes the data to the table.  At the end of that function it sets
variables.ID to the ID of the record it just created.

4)  Here is where I am confused.  Do I need to make another call to
get that variables.ID value?  The getID function that you mentioned is
an "access=public" function inside the parts.cfc component and not the
partsGateway.cfc component.  If I need to call getID separately, I am
confused on how to do that since it is not an "access=remote" function.

Once again I REALLY appreciate your time helping me.  I feel like the
answer is right under my nose! :)

--- In [email protected], "Bill Sahlas" <[EMAIL PROTECTED]> wrote:
>
> When this line executes in the BEAN's create method
>
> ...
>
>                         <cfset variables.ID = qGetID.ID>
>
> ...
>
> It is setting the BEAN's ID property. 
>

>
> You access it using the Remote Object method -
>             <cffunction name="getID" output="false" access="public"
> returntype="any">
>
>                         <cfreturn variables.ID>
>
>             </cffunction>
>

>

>

>
>             <mx:RemoteObject
>
>                         id="dataManager"
>
>                         showBusyCursor="true"
>
>                         destination="ColdFusion" source="myBEANObject">
>
>                         <mx:method name="getID" result="result(event)"
> fault=" fault(event)" />
>
>             </mx:RemoteObject>
>

>
> Does this make sense to you?  Am I missing something else?
>
> ________________________________
>
> From: [email protected] [mailto:[email protected]] On
> Behalf Of g8torjoe
> Sent: Friday, May 26, 2006 1:47 PM
> To: [email protected]
> Subject: [flexcoders] Re: Question on CF components created by the Flex
> Wizard
>

>
> Bill, thank you very much for your time and response.  I apologize
> that I am still a little confused.  I am using beta 3 and the code
> below was generated by the wizard automatically (at the end of the
> create function):
>
>                   <!--- If your server has a better way to get the ID
> that is more
> reliable, use that instead --->
>                   <cfquery name="qGetID" datasource="myDB_sql">
>                         select ID
>                         from dbo.partsShipAddr
>                         where Name = <cfqueryparam value="#local1#"
> cfsqltype="CF_SQL_VARCHAR" />
>                           and Addr1 = <cfqueryparam value="#local2#"
> cfsqltype="CF_SQL_VARCHAR" />
>                           and Addr2 = <cfqueryparam value="#local3#"
> cfsqltype="CF_SQL_VARCHAR" />
>                           and City = <cfqueryparam value="#local4#"
> cfsqltype="CF_SQL_VARCHAR" />
>                           and State = <cfqueryparam value="#local5#"
> cfsqltype="CF_SQL_VARCHAR" />
>                           and Zip = <cfqueryparam value="#local6#"
> cfsqltype="CF_SQL_VARCHAR" />
>                           and Phone = <cfqueryparam value="#local7#"
> cfsqltype="CF_SQL_VARCHAR" />
>                           and Email = <cfqueryparam value="#local8#"
> cfsqltype="CF_SQL_VARCHAR" />
>                           and Comments = <cfqueryparam value="#local9#"
> cfsqltype="CF_SQL_VARCHAR" />
>                           and PurchaseLoc = <cfqueryparam
> value="#local10#"
> cfsqltype="CF_SQL_VARCHAR" />
>                         order by ID desc
>                   </cfquery>
>             </cftransaction>
>
>             <cfset variables.ID = qGetID.ID>
>
> This seems to be what you were referring to with creating a SELECT
> statement with the exact conditions of my update.  I guess my
> confusion is that I don't see where variables.ID is getting passed
> back to the automatically created gateway component and then back to
> Flex.  Does that make any sense?
>
> Thanks again!!!
>
>
>
> --- In [email protected], "Bill Sahlas" <bsahlas@> wrote:
> >
> > We thought about exposing the returned ID (ID that gets created for
> > AUTOINCREMENT keys) in the CFQUERY RESULT, a new attribute available
> as
> > part of CFMX 7.x.  But, the process to get this is not always
> supported
> > by the backend DBs so we backed off this feature for now.  You'll need
> > to code this yourself in the release that you currently have by using
> a
> > SELECT statement with a WHERE clause whose criteria is identical to
> the
> > values that you used in the INSERT statement.  For the final release
> > this code is already gen'd by the wizard.
> >
> > 
> >
> > ________________________________
> >
> > From: [email protected] [mailto:[email protected]]
> On
> > Behalf Of g8torjoe
> > Sent: Thursday, May 25, 2006 3:17 PM
> > To: [email protected]
> > Subject: [flexcoders] Question on CF components created by the Flex
> > Wizard
> >
> > 
> >
> > I am having a little trouble following the flow of the CF components
> > created by the wizard in Flex. I am using the save function of the
> > gateway component and writing to the database successfully. When I
> > create a new record I am wondering if the ID (or key - mine is ID)
> > should be returned. I see in the component that is searches for the ID
> > after I add it but when I debug my Flex app in the result event
> > handler I am not finding that data. Am I making an assumption here?
> > Thanks!
> >
> >
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> >
> >
> >
> >
> > SPONSORED LINKS
> >
> > Web site design development
> >
> <http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+
> >
> site+design+development&w2=Computer+software+development&w3=Software+des
> >
> ign+and+development&w4=Macromedia+flex&w5=Software+development+best+prac
> > tice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ> 
> >
> > Computer software development
> >
> <http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=We
> >
> b+site+design+development&w2=Computer+software+development&w3=Software+d
> >
> esign+and+development&w4=Macromedia+flex&w5=Software+development+best+pr
> > actice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw> 
> >
> > Software design and development
> >
> <http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=
> >
> Web+site+design+development&w2=Computer+software+development&w3=Software
> >
> +design+and+development&w4=Macromedia+flex&w5=Software+development+best+
> > practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ> 
> >
> > Macromedia flex
> >
> <http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+
> >
> development&w2=Computer+software+development&w3=Software+design+and+deve
> >
> lopment&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=1
> > 66&.sig=OO6nPIrz7_EpZI36cYzBjw> 
> >
> > Software development best practice
> >
> <http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&
> >
> w1=Web+site+design+development&w2=Computer+software+development&w3=Softw
> >
> are+design+and+development&w4=Macromedia+flex&w5=Software+development+be
> > st+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw> 
> >
> > 
> >
> > 
> >
> > ________________________________
> >
> > YAHOO! GROUPS LINKS
> >
> > 
> >
> > *      Visit your group "flexcoders
> > <http://groups.yahoo.com/group/flexcoders> " on the web.
> >        
> > *      To unsubscribe from this group, send an email to:
> >       [EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>
> >        
> > *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > Service <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
>
>
>
>
> SPONSORED LINKS
>
> Web site design development
> <http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+
> site+design+development&w2=Computer+software+development&w3=Software+des
> ign+and+development&w4=Macromedia+flex&w5=Software+development+best+prac
> tice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ> 
>
> Computer software development
> <http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=We
> b+site+design+development&w2=Computer+software+development&w3=Software+d
> esign+and+development&w4=Macromedia+flex&w5=Software+development+best+pr
> actice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw> 
>
> Software design and development
> <http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=
> Web+site+design+development&w2=Computer+software+development&w3=Software
> +design+and+development&w4=Macromedia+flex&w5=Software+development+best+
> practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ> 
>
> Macromedia flex
> <http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+
> development&w2=Computer+software+development&w3=Software+design+and+deve
> lopment&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=1
> 66&.sig=OO6nPIrz7_EpZI36cYzBjw> 
>
> Software development best practice
> <http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&
> w1=Web+site+design+development&w2=Computer+software+development&w3=Softw
> are+design+and+development&w4=Macromedia+flex&w5=Software+development+be
> st+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw> 
>

>

>
> ________________________________
>
> YAHOO! GROUPS LINKS
>

>
> *      Visit your group "flexcoders
> <http://groups.yahoo.com/group/flexcoders> " on the web.
>        
> *      To unsubscribe from this group, send an email to:
>       [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>        
> *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to