Solved

Flash remoting with coldfusion getting the simple query results from cfc

Posted on 2004-10-09
10
245 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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
 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

816 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

9 Experts available now in Live!

Get 1:1 Help Now