Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

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
0
tagtekin
Asked:
tagtekin
  • 5
  • 3
1 Solution
 
negatyveCommented:
first of all, your method is:

MovieRecordSetProvider

not

MoviveRecordSetProvider
0
 
negatyveCommented:
then, if the textfield instance name is "users", you should call it this way:

myService.MovieRecordSetProvider(users.text);
0
 
tagtekinAuthor Commented:
---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.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
tagtekinAuthor Commented:
--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.
0
 
tagtekinAuthor Commented:
--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.
0
 
tagtekinAuthor Commented:
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>
0
 
tagtekinAuthor Commented:
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);


}

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now