Solved

Flash remoting with coldfusion getting the simple query results from cfc

Posted on 2004-10-09
10
223 Views
Last Modified: 2013-12-16
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
Comment
Question by:tagtekin
  • 5
  • 3
10 Comments
 
LVL 27

Expert Comment

by:negatyve
ID: 12270288
first of all, your method is:

MovieRecordSetProvider

not

MoviveRecordSetProvider
0
 
LVL 27

Accepted Solution

by:
negatyve earned 500 total points
ID: 12270326
then, if the textfield instance name is "users", you should call it this way:

myService.MovieRecordSetProvider(users.text);
0
 

Author Comment

by:tagtekin
ID: 12271066
---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
 

Author Comment

by:tagtekin
ID: 12271603
--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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:tagtekin
ID: 12271609
--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
 

Author Comment

by:tagtekin
ID: 12271728
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
 

Author Comment

by:tagtekin
ID: 12271844
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
 
LVL 27

Expert Comment

by:negatyve
ID: 12273064
yes it is, but you should target your textfield text property...
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now