Link to home
Start Free TrialLog in
Avatar of tagtekin
tagtekin

asked on

Flash remoting with coldfusion getting the simple query results from cfc

How to get simple query results from cfc where the value of the parameter "un" is defined in the flash textbox.

------This is the cfc file---------------
<cfcomponent hint="Provides all data about the movies.">
<cffunction name="MovieRecordSetProvider" hint="Returns an array to populate the listBox." returntype="query" access="remote">
<CFQUERY NAME="listQuery" DATASOURCE="brochure">
    SELECT *
    FROM brochuredata
    WHERE un =#FLASH.UN#
    </CFQUERY>
</cfcomponent>

----following is in the flash first frame----
UN = "users";
#include "NetServices.as"
#include "Dataglue.as"
// Remoting functions
if (inited == null) {
      inited = true;
      NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
      gateway_conn = NetServices.createGatewayConnection();
      myService = gateway_conn.getService("Remoting.transactions", this);
      //myService.MovieRecordSetProvider();
    myService.MoviveRecordSetProvider(un:users);
}

When I execute this i get
NetServices info 2: MoviveRecordSetProvider_Status was received from server:  Service threw an exception during method invocation: CF Adapter: Service Remoting.transactions does not have a method "MoviveRecordSetProvider" that matches the name and parameters provided.

thanks for the help guys
Avatar of negatyve
negatyve

first of all, your method is:

MovieRecordSetProvider

not

MoviveRecordSetProvider
ASKER CERTIFIED SOLUTION
Avatar of negatyve
negatyve

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tagtekin

ASKER

---un is the text box name and also one of the db identifer------
un = "Joe";
#include "NetServices.as"
#include "Dataglue.as"
// Remoting functions
if (inited == null) {
     inited = true;
     NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
     gateway_conn = NetServices.createGatewayConnection();
     myService = gateway_conn.getService("Remoting.transactions", this);
     //myService.MovieRecordSetProvider();
    myService.MoviveRecordSetProvider(un.text);
}

------This is the cfc file---------------
<cfcomponent hint="Provides all data about the movies.">
<cffunction name="MovieRecordSetProvider" hint="Returns an array to populate the listBox." returntype="query" access="remote">
<CFQUERY NAME="listQuery" DATASOURCE="brochure">
    SELECT *
    FROM brochuredata
    WHERE un =#FLASH.UN#
    </CFQUERY>
</cfcomponent>
-----this time i get----
NetServices info 2: MoviveRecordSetProvider_Status was received from server:  Service threw an exception during method invocation: CF Adapter: Service Remoting.transactions does not have a method "MoviveRecordSetProvider" that matches the name and parameters provided.
--this is with the fixed function--- I get the following error

NetServices info 2: MovieRecordSetProvider_Status was received from server:  Service threw an exception during method invocation: Element UN is undefined in FLASH.

---un is the text box name and also one of the db identifer------
un = "Joe";
#include "NetServices.as"
#include "Dataglue.as"
// Remoting functions
if (inited == null) {
     inited = true;
     NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
     gateway_conn = NetServices.createGatewayConnection();
     myService = gateway_conn.getService("Remoting.transactions", this);
     //myService.MovieRecordSetProvider();
    myService.MoviveRecordSetProvider(un.text);
}

------This is the cfc file---------------
<cfcomponent hint="Provides all data about the movies.">
<cffunction name="MovieRecordSetProvider" hint="Returns an array to populate the listBox." returntype="query" access="remote">
<CFQUERY NAME="listQuery" DATASOURCE="brochure">
    SELECT *
    FROM brochuredata
    WHERE un =#FLASH.UN#
    </CFQUERY>
</cfcomponent>
-----this time i get----
NetServices info 2: MoviveRecordSetProvider_Status was received from server:  Service threw an exception during method invocation: CF Adapter: Service Remoting.transactions does not have a method "MoviveRecordSetProvider" that matches the name and parameters provided.
--this is with the fixed function--- I get the following error

NetServices info 2: MovieRecordSetProvider_Status was received from server:  Service threw an exception during method invocation: Element UN is undefined in FLASH.

---un is the text box name and also one of the db identifer------
un = "Joe";
#include "NetServices.as"
#include "Dataglue.as"
// Remoting functions
if (inited == null) {
     inited = true;
     NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
     gateway_conn = NetServices.createGatewayConnection();
     myService = gateway_conn.getService("Remoting.transactions", this);
     //myService.MovieRecordSetProvider();
    myService.MovieRecordSetProvider(un.text);
}

------This is the cfc file---------------
<cfcomponent hint="Provides all data about the movies.">
<cffunction name="MovieRecordSetProvider" hint="Returns an array to populate the listBox." returntype="query" access="remote">
<CFQUERY NAME="listQuery" DATASOURCE="brochure">
    SELECT *
    FROM brochuredata
    WHERE un =#FLASH.UN#
    </CFQUERY>
</cfcomponent>
-----this time i get----
NetServices info 2: MoviveRecordSetProvider_Status was received from server:  Service threw an exception during method invocation: CF Adapter: Service Remoting.transactions does not have a method "MoviveRecordSetProvider" that matches the name and parameters provided.
This time I get the following. I feel like i am getting closer. Thanks or the help

NetServices info 2: MovieRecordSetProvider_Status was received from server:  Service threw an exception during method invocation: Error Executing Database Query.


un = "joe";
#include "NetServices.as"
#include "Dataglue.as"
// Remoting functions
if (inited == null) {
     inited = true;
     NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
     gateway_conn = NetServices.createGatewayConnection();
     myService = gateway_conn.getService("Remoting.transactions", this);
     //myService.MovieRecordSetProvider();
    myService.MovieRecordSetProvider(un);


}
function MovieRecordSetProvider_Result(result) {
      var detailRecord = result.getItemAt(1);
      movieDetail.text = detailRecord.id;
      
}

<cfcomponent hint="Provides all data about the movies.">

<cffunction name="MovieRecordSetProvider" hint="Returns an array to populate the listBox." returntype="query" access="remote">
    <!--- Query the database for story records --->
   <CFARGUMENT NAME="un" TYPE="string">

      <CFQUERY NAME="listQuery" DATASOURCE="brochure">
    SELECT *
    FROM brochuredata
    WHERE un =#arguments.un#
   
      </CFQUERY>
    <CFRETURN listQuery>

  </cffunction>
  </cfcomponent>
Ahaa got it here s the correct code

<cfcomponent hint="Provides all data about the movies.">

<cffunction name="MovieRecordSetProvider" hint="Returns an array to populate the listBox." returntype="query" access="remote">
    <!--- Query the database for story records --->
   <CFARGUMENT NAME="un" TYPE="string" required="true">

      <CFQUERY NAME="listQuery" DATASOURCE="brochure">
    SELECT *
    FROM brochuredata
  WHERE un ='#un#'
   
      </CFQUERY>
    <CFRETURN listQuery>

  </cffunction>
un = "Joe";
#include "NetServices.as"
#include "Dataglue.as"
// Remoting functions
if (inited == null) {
     inited = true;
     NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
     gateway_conn = NetServices.createGatewayConnection();
     myService = gateway_conn.getService("Remoting.transactions", this);
     //myService.MovieRecordSetProvider();
     myService.MovieRecordSetProvider(un);
       trace(un);


}

yes it is, but you should target your textfield text property...