RemoteObject Data Calls

RemoteObject Data Calls

Hi.....

please tell me about
How do I make synchronous data calls?
please give me an example for that......

Thanks
View Answers

October 22, 2010 at 11:02 AM

Ans:

You cannot make synchronous calls. You must use the result event. No, you can't use a loop, setInterval, or even doLater. This paradigm is quite aggravating at first. Take a deep breath, surrender to the inevitable, resistance is futile.

There is a generic way to handle the asynchronous nature of data service calls, called ACT (Asynchronous Call Token). Search for this in the Developing Flex Applications LiveDocs for a full description.

Here it is in a nutshell. This example uses HTTPService but will be similar for RemoteObject and WebService:

  1. Create a function to handle the data return, like onResult().
  2. In the HTTPService tag, put this function name in the result property and pass "event" in too.
  3. Invoke the call in the script:

//invokes the call to the HTTP data service

var oRequestCallbject = app.mxdsGetData.send(oRequest);

//Next, define a string to identify the call. We will use this string value in the result handler.

oRequestCall.MyQueryId = "WhateverIWanttoUseToIdentifyThisCall" ;

//Yes, you CAN set this AFTER you invoke send()

  1. In the result handler, which will be called every time the data service call returns, identify what the returned data contains, as follows:

    var callResponse = oEvent.call; //get the call object //gets the value of this property you set in the call var sQueryId = callResponse.MyQueryId; //will be "WhateverIWanttoUseToIdentifyThisCall"; trace(sQueryId);









Related Tutorials/Questions & Answers:
RemoteObject Data Calls
RemoteObject Data Calls  Hi..... please tell me about How do I make synchronous data calls? please give me an example for that...... Thanks
RemoteObject
. RemoteObject 2. HTTPService 3. WebService
Advertisements
RemoteObject in flex
RemoteObject in flex  Hi..... Why are my ValueObject member variables undefined in the results from my RemoteObjects requests? Please give me the answer Thanks
RemoteObject in flex
RemoteObject in flex  Hi..... Please give me the solution of this problem How do I get access to the J2EE session from my RemoteObjects? please give the answer with example ASAP Thanks
ModuleNotFoundError: No module named 'log_calls'
ModuleNotFoundError: No module named 'log_calls'  Hi, My Python... 'log_calls' How to remove the ModuleNotFoundError: No module named 'log_calls' error? Thanks   Hi, In your python environment you
Mocking a service that calls another service
Mocking a service that calls another service  I have a method, say m1 in class, say C1. Method m1 calls a method, say m2 from another service class, say C2. So I mock m2 in junit test-cases for m1. However, m2 itself calls
ModuleNotFoundError: No module named 'asterisk-calls-agent'
ModuleNotFoundError: No module named 'asterisk-calls-agent'  Hi...: No module named 'asterisk-calls-agent' How to remove the ModuleNotFoundError: No module named 'asterisk-calls-agent' error? Thanks   Hi
ModuleNotFoundError: No module named 'measure-horseshoe-bat-calls'
ModuleNotFoundError: No module named 'measure-horseshoe-bat-calls'  ...: No module named 'measure-horseshoe-bat-calls' How to remove the ModuleNotFoundError: No module named 'measure-horseshoe-bat-calls' error? Thanks
ModuleNotFoundError: No module named 'measure-horseshoe-bat-calls'
ModuleNotFoundError: No module named 'measure-horseshoe-bat-calls'  ...: No module named 'measure-horseshoe-bat-calls' How to remove the ModuleNotFoundError: No module named 'measure-horseshoe-bat-calls' error? Thanks
ModuleNotFoundError: No module named 'asterisk-calls-agent'
ModuleNotFoundError: No module named 'asterisk-calls-agent'  Hi...: No module named 'asterisk-calls-agent' How to remove the ModuleNotFoundError: No module named 'asterisk-calls-agent' error? Thanks   Hi
java code(API calls) - Java Beginners
java code(API calls)  How to insert an image into Word document?????????can any one tell the API call for inserting an image or picture into word document............using JAVA(APACHE POI PACKAGE (Word-HWPF))plzzzzzzzz
Implement mechanisms for efficient inter-component calls
Implement mechanisms for efficient inter-component calls Prev Chapter 1. Design, build and test...; Implement mechanisms for efficient inter-component calls Bean Interfaces
About method calls
data
data  Handling data
data
data  data Handling AOP
data
data  Handling data in AOP
data
data handling examples in AOP Model  data handling examples in AOP Model
Difference between httpService and Data Service
Difference between httpService and Data Service  Hi.. Please tell me What is the difference between httpService and Data Service? Thanks  Solution: When we use flex Data Services we have to need
Data call in flex
data calls?" ADS_TO_REPLACE_2 Thanks...Data call in flex  Hi.... I'm sending my request, and I see the data traffic in the command window, but why is the result always empty? Please give
importing data and edit that data
importing data and edit that data   hello sir i have data in excel sheet which contain 2 rows and i want to import that data to ms access and edit that data like adding new columns and new rows and creating new tables
big data and data science
big data and data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: big data and data science Try to provide me good examples or tutorials links so that I can
data science and data analytics
data science and data analytics  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data science and data analytics Try to provide me good examples or tutorials links so
big data data science
big data data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: big data data... the topic "big data data science". Also tell me which is the good
data science data analytics
data science data analytics  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data science data analytics Try to provide me good examples or tutorials links so that I
data visualization in data science
data visualization in data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data visualization in data science Try to provide me good examples or tutorials
data science and data mining
data science and data mining  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data science and data mining Try to provide me good examples or tutorials links so that I
data mining data science
data mining data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data mining data science Try to provide me good examples or tutorials links so that I can
What is Big Data and Data mining
What is Big Data and Data mining  Hi, Big Data, Data Mining and Data analytics are hot topic these days. What is Big Data and Data mining? Thanks
What is Big Data and Data mining
What is Big Data and Data mining  Hi, Big Data, Data Mining and Data analytics are hot topic these days. What is Big Data and Data mining? Thanks
Java Xml Data Store
Java Xml Data Store  I have to do this project and i'm finding it so... she passes it on to. When making follow up calls she needs to be able to list... be followed up and/or purchased. You will need to store the data in a local binary
data processing is
data processing is   data processing is   Data processing is associated with commercial work. Data processing is also referred as Information System. Data processing is basically used for analyzing, processing
data tyape
data tyape   please give me data type of Date
data tyape
data tyape   please give me data type of Date
data tyape
data type of Date  please give me data type of Date
data tyape
data tyape   please give me data type of Date
jsp data in excel - JSP-Servlet
jsp data in excel  i have create jsp page which has button for excel.this calls jsp which contains code which has and then code for present data in jsp using table. and getting this data from servlet which has query
data type
data type  which data type is used to store video file in mysql databse
data tyape
What data tyape a date field req in SQL   please give me data type of Date
data tyape
data type of date in mysql  please give me data type of Date
data science and big data analytics
data science and big data analytics  Hi, I am beginner in Data...: data science and big data analytics Try to provide me good examples or tutorials links so that I can learn the topic "data science and big data
certificate in big data and data analytics
certificate in big data and data analytics  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: certificate in big data and data analytics Try to provide me good examples
Is big data necessary for data science?
Is big data necessary for data science?  Hi, I am beginner in Data...: Is big data necessary for data science? Try to provide me good examples or tutorials links so that I can learn the topic "Is big data necessary
Is big data and data science same?
Is big data and data science same?  Hi, I am beginner in Data...: Is big data and data science same? Try to provide me good examples or tutorials links so that I can learn the topic "Is big data and data science same?"
Is Data Analyst same as data scientist?
Is Data Analyst same as data scientist?  Hi, I am beginner in Data...: Is Data Analyst same as data scientist? Try to provide me good examples or tutorials links so that I can learn the topic "Is Data Analyst same as data
data wrangling vs data cleaning
data wrangling vs data cleaning  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data wrangling vs data cleaning Try to provide me good examples or tutorials links so
data wrangling vs data mining
data wrangling vs data mining  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data wrangling vs data mining Try to provide me good examples or tutorials links so
PHP XML and PHP Backends Sharing Data Tutorial
PHP XML and PHP Backends Sharing Data Tutorial       PHP XML and PHP Backends Sharing Data Tutorial What if you could script remote procedure calls between web sites as easily as you can do
Data objects
Data objects   hello,, What are data objects?   hii,ADS_TO_REPLACE_1 Sequences, Views, clusters, Tables, index and cluster are called data objects for a database
data science
data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data science Try...;data science". Also tell me which is the good training courses in Machine
data sains
data sains  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data sains Try to provide me good examples or tutorials links so that I can learn the topic "data

Ads