Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Flex RemoteObject Data Calls
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


bikrantsingh
RemoteObject Data Calls
1 Answer(s)      4 years and 2 months ago
Posted in : Flex


Hi.....

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

Thanks

Advertisement
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
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
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
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
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
Data call in flex
synchronous behavior? You can't do this. See "How do I make synchronous data calls...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
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 type of Date  please give me data type of Date
data tyape
data tyape   please give me data type of Date
data tyape
data tyape   please give me data type of Date
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 type
data type  which data type is used to store video file in mysql databse
Data objects
Data objects   hello,, What are data objects?   hii, Sequences, Views, clusters, Tables, index and cluster are called data objects for a database
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 Generator
Data Generator Data Generator is free open source script that is designed to create the application, which can be used to generate a large sum of data... JavaScript, PHP and MySQL. Characteristics Data generator is browser
data types
data types  Write a short note on data types of Java.   Please visit the following link: Java datatypes
no data in db
no data in db  Using the example in "Networking/web-services-database.shtml" managed to do everything as shown above but there is no data in the database. the result is "record inserted". where can the error
Data Retrival
Data Retrival  How to get the output With in 2 mins for more than 13 lakhs records
login data
login data   Hiiii Sir I am doing banking project on Asp.net i have... the data after login i want to show particular data for particular user means if i login i wanna see only myn data how shud i do thanxx in advance
displaying data
displaying data   how to display data from database on jsp using struts2
Advertisements
 

 

 

DMCA.com