I've got a problem with the create function of my ContactDAO.cfc. If I change

    <cfset var local3=arguments.bean.getImage()>

to

    <cfset var local3='testimg'>

it updates the database with testimg in the img column. But if I leave it at:

    <cfset var local3=arguments.bean.getImage()>

it doesn't take the value i put in my flex form, instead it updates the database with an empty string, but the name and location values get updated just fine. My create function has this argument declaration at the top:


    <cfset var local1=arguments.bean.getName()>
    <cfset var local2=arguments.bean.getLocation()>
    <cfset var local3=arguments.bean.getImage()>

And my com.mydomain.model.ContactVO cfcomponent has these functions in it:


   
    <cffunction name="getName" output="false" access="public" returntype="any">
        <cfreturn variables.name>
    </cffunction>

    <cffunction name="setName" output="false" access="public" returntype="void">
        <cfargument name="val" required="true">
        <cfset variables.name = arguments.val>
    </cffunction>

    <cffunction name="getLocation" output="false" access="public" returntype="any">
        <cfreturn variables.location>
    </cffunction>

    <cffunction name="setLocation" output="false" access="public" returntype="void">
        <cfargument name="val" required="true">
        <cfset variables.location = arguments.val>
    </cffunction>

    <cffunction name="getImage" output="false" access="public" returntype="any">
        <cfreturn variables.img>
    </cffunction>

    <cffunction name="setImage" output="false" access="public" returntype="void">
        <cfargument name="val" required="true">
        <cfset variables.img = arguments.val>

And my ContactVO.as file looks like this:

package com.mydomain.model {

    import org.nevis.cairngorm.vo.ValueObject;
    import mx.data.IManaged;
    import mx.core.mx_internal;

    [Managed]
    [RemoteClass(alias="com.mydomain.model.ContactVO")]
    public class ContactVO implements ValueObject {
       
        public var contactId:Number;
        public var name:String;
        public var location:String;
        public var img:String;
       
    }
}

And I've got this in my contactmgr.xml file:

    ...


        private function newContact():void
        {
            dg.selectedIndex = -1;
            contact = new ContactVO();
        }

    //other script code

    ...
   
    <mx:Binding source="title.text" destination="contact.name"/>
    <mx:Binding source="location.text" destination="contact.location"/>
    <mx:Binding source="img.text" destination="contact.img"/>


    ...

    //other mxml code

I've tried some of the suggestions that Benoit suggested in his "BUGS" section of this thread  he started for a CF/Flex sample app. I'm using the cfcontact example as my foundation, and DataService calls. Any ideas?


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