Changes between Version 3 and Version 4 of HowTos/HowToUseRemoting

Show
Ignore:
Timestamp:
02/04/10 05:44:17 (16 years ago)
Author:
kpenny@… (IP: 75.101.164.182)
Comment:

Just some grammer/typo corrections.

Legend:

Unmodified
Added
Removed
Modified
  • HowTos/HowToUseRemoting

    v3 v4  
    167167}}} 
    168168 
    169 We define our Remote Object service with the "mx:RemoteObject" tag. In this tag, we called the standard "!ColdFusion" service defined in your remoting-config.xml in your flex folder on the !ColdFusion server. The source defines the specific cfc we will are calling which in with our MG3 app will always be the !RemotingService.cfc. When the result comes back, we have a function called "resultHandler()" which will process the data. 
     169We define our Remote Object service with the "mx:RemoteObject" tag. In this tag, we called the standard "!ColdFusion" service defined in your remoting-config.xml in your flex folder on the !ColdFusion server. The source defines the specific cfc we are calling which in our MG3 app will always be the !RemotingService.cfc. When the result comes back, we have a function called "resultHandler()" which will process the data. 
    170170 
    171171When this Flex application runs, we start off with calling the init() function with our creationComplete() located near the top of the file. The init() makes the remote object call to the "executeEvent" method located in the !RemotingService.cfc. That method has 3 arguments. The first argument is the event string. This is exactly the same value you would use in the url in a normal MG3 application. The second argument is are values you need to submit with the event. In this example we didn't have any values to submit, but for future reference you simply can submit values as an object of name/value pairs like so, {Param1:"Hi!", Param2:76}. The third argument is the MG3 event object key we want back. MG normally returns lots of things in the "event" object. For our purposes, we just want the "users" object. 
     
    220220}}} 
    221221 
    222 The $(document).ready() fires up after the page is loaded. We start off by setting some variables. We will call the !RemotingService.cfc directly by url. When we do this, we can also specify the return format. The default is WDDX but the JSON format is prefer for AJAX applications. The "queryFormat=column" provides some additional information which we use in handling the loop later on. 
     222The $(document).ready() fires up after the page is loaded. We start off by setting some variables. We will call the !RemotingService.cfc directly by url. When we do this, we can also specify the return format. The default is WDDX but the JSON format is preferred for AJAX applications. The "queryFormat=column" provides some additional information which we use in handling the loop later on. 
    223223 
    224224Like the previous Flex example, we have two critical variables to define. The first is the MG3 "event name" we wish to call and the second is the event object key (basically the returned values) we need back for the remoting call. We can also set additional arguments if required. 
    225225 
    226 If the call is successful, then we loop over the result and build out a html string of list items "<li>". This html string is then appended into the 'users' div area on the page. When you run this page you should initial see a single line saying "Processing.." for a second then the following result. 
     226If the call is successful, then we loop over the result and build out a html string of list items "<li>". This html string is then appended into the 'users' div area on the page. When you run this page you should initially see a single line saying "Processing.." for a second then the following result. 
    227227 
    228228(Image in progress)