[flexcoders] Re: strange problem with remote object
Ooops. Sorry about that. I don't normally send (Or receive) my data like that; I always use value objects (Or Data Transfer Objects or whatever they are called nowadays). Glad to be of some help. Steve --- In flexcoders@yahoogroups.com, "johndoematrix" wrote: > > hey, thanks guys for helping i have it working now. i googled passing flex > parameters in remoteobject as tracy suggested and the solution was just as > valdhor had suggested except valdhor missed the arguments tag otherwise this > is how it is in my remote object > > source="login_example3.cfc.login"> >result="concernOriginalReceived(event)" > fault="Alert.show(event.fault.faultString,'Error');"> > > {username.text} > {password.text} > > > > > thanks again guys. keep up the good work >
[flexcoders] Re: strange problem with remote object
hey, thanks guys for helping i have it working now. i googled passing flex parameters in remoteobject as tracy suggested and the solution was just as valdhor had suggested except valdhor missed the arguments tag otherwise this is how it is in my remote object {username.text} {password.text} thanks again guys. keep up the good work
RE: [flexcoders] Re: strange problem with remote object
Ah, no, a Flex form does *not* automatically submit any parameters. Google: flex pass parameters to remoteObject method (I think I suggested this already) Look at the first hit. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of johndoematrix Sent: Tuesday, March 24, 2009 1:13 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: strange problem with remote object Hi thanks for trying to help but i think you are not geting what am trying to do here. Valdhor in my updates code i got rid of the creationComplete thing and i created a button which when clicked fires "remoteObj.userData.send();" but that didn't work. i guess you did not look at my updated code. Tracy i am passing arguments to the remote object from the form inputs (at least thats what i think) so that when my button is clicked and fires "remoteObj.userData.send();" it can send the parameters from the form to the cfc. overall i would like to return data corresponding to the two fields (username and password) from the database to the datagrid. i hope that what am trying to achieve here is well explained. i have a feeling am missing something so i beg to be directed. thanks
[flexcoders] Re: strange problem with remote object
Hi thanks for trying to help but i think you are not geting what am trying to do here. Valdhor in my updates code i got rid of the creationComplete thing and i created a button which when clicked fires "remoteObj.userData.send();" but that didn't work. i guess you did not look at my updated code. Tracy i am passing arguments to the remote object from the form inputs (at least thats what i think) so that when my button is clicked and fires "remoteObj.userData.send();" it can send the parameters from the form to the cfc. overall i would like to return data corresponding to the two fields (username and password) from the database to the datagrid. i hope that what am trying to achieve here is well explained. i have a feeling am missing something so i beg to be directed. thanks
RE: [flexcoders] Re: strange problem with remote object
The html form is passing arguments to the CFC in hidden input fields. How are you passing arguments to the remoteObject method? Hint, google: passing arguments to remoteObject method Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of johndoematrix Sent: Monday, March 23, 2009 10:07 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: strange problem with remote object guys any help? frankly i can't see whats wrong with my code. probably something i dont see.
[flexcoders] Re: strange problem with remote object
The problem is that you are not sending any data from Flex. You have remoteObj.userData.send() on creationComplete but you do not have any parameters for that function so no data is sent. The CF code requires the username and password parameters but does not get them. You obviously want to send this data with your call but you can't if you invoke the remoteObject call on creationComplete. So, the first thing to do is remove the invocation from creationComplete. Next, you should add a button to your form and create a function to run on click of the button. private function doLogin():void { remoteObj.userData.send(); } {username} {password} This is only one way of doing it. There are others. I would recommend using Charles (http://www.charlesproxy.com) to debug these kinds of errors. You would see very quickly that Flex did not send any data. HTH Steve --- In flexcoders@yahoogroups.com, "johndoematrix" wrote: > > guys i just read up on this and am doing it the same way as the example. here > is the example i refered to just to be sure i got this right. > > Passing parameters using a form > > To pass parameters to components using an HTML or ColdFusion form, the names > of the client input controls must match the names of the parameter definition > in the component file. > To pass parameters using a form: > >1. Open the corpFind.cfm file and modify the code so that it appears as > follows: > > Find People and Products > > Enter employee's last Name: > > > > > > Enter maximum product price: > > > > > > In the example, the form tag action attribute points to the corpQuery > component. The input tags invoke the component method. >2. Open corpQuery.cfc and add access="remote" to each cffunction tag, as > the following example shows: > > > > > > SELECT LASTNAME, FIRSTNAME, EMAIL > FROM tblEmployees > WHERE LASTNAME LIKE '#arguments.lastName#' > >Results filtered by #arguments.lastName#: > > > > > > SELECT ItemName, ItemDescription, ItemCost > FROM tblItems > WHERE ItemCost <= #arguments.cost# > >Results filtered by #arguments.cost#: > > > > > In this example, the cffunction access attribute lets remote clients, > such as web browsers and Flash applications, to access component methods. > > this is not different from what am doing the only difference may is that am > using a flex form but i think that doesn't matter. >
[flexcoders] Re: strange problem with remote object
guys any help? frankly i can't see whats wrong with my code. probably something i dont see.
[flexcoders] Re: strange problem with remote object
guys i just read up on this and am doing it the same way as the example. here is the example i refered to just to be sure i got this right. Passing parameters using a form To pass parameters to components using an HTML or ColdFusion form, the names of the client input controls must match the names of the parameter definition in the component file. To pass parameters using a form: 1. Open the corpFind.cfm file and modify the code so that it appears as follows: Find People and Products Enter employee's last Name: Enter maximum product price: In the example, the form tag action attribute points to the corpQuery component. The input tags invoke the component method. 2. Open corpQuery.cfc and add access="remote" to each cffunction tag, as the following example shows: SELECT LASTNAME, FIRSTNAME, EMAIL FROM tblEmployees WHERE LASTNAME LIKE '#arguments.lastName#' Results filtered by #arguments.lastName#: SELECT ItemName, ItemDescription, ItemCost FROM tblItems WHERE ItemCost <= #arguments.cost# Results filtered by #arguments.cost#: In this example, the cffunction access attribute lets remote clients, such as web browsers and Flash applications, to access component methods. this is not different from what am doing the only difference may is that am using a flex form but i think that doesn't matter.
[flexcoders] Re: strange problem with remote object
Tracy could you please show me how to pass the parameters to the method. this is the only way i have always known to get items from a database.thanks
RE: [flexcoders] Re: strange problem with remote object
You are not passing the username and password parameters to the to the method. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of johndoematrix Sent: Monday, March 23, 2009 1:08 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: strange problem with remote object i tried to change my code after reading through some coldfusion flex tutorials but i get the same error msg "Unable to invoke CFC - The UNAME parameter to the userData function is required but was not passed in.". here is my new code "cfc function" SELECT * FROM profile where username like '%#arguments.uname#%' and Password like '%#arguments.pswd#%' "mxml page" http://www.adobe. <http://www.adobe.com/2006/mxml> com/2006/mxml" width="100%" height="100%" backgroundColor="#40">
[flexcoders] Re: strange problem with remote object
i tried to change my code after reading through some coldfusion flex tutorials but i get the same error msg "Unable to invoke CFC - The UNAME parameter to the userData function is required but was not passed in.". here is my new code "cfc function" SELECT * FROM profile where username like '%#arguments.uname#%' and Password like '%#arguments.pswd#%' "mxml page" http://www.adobe.com/2006/mxml"; width="100%" height="100%" backgroundColor="#40">