Skip to content

How Do I Do Remoting

dskaggs edited this page Jan 9, 2013 · 2 revisions

The RemoteService is a mechanism to use the logic and work flows configured in your Model-Glue application for uses beyond the typical HTML application. For example, you can access your Model-Glue application to get data for an Ajax or a Flex client as well.

If you are doing Ajax work, and just doing div replacement style coding, you do not need the RemoteService, only if you want to return raw data does it become important.

There is a full article series describing the RemotingService already, below is the readers digest version illustrating the main ideas:

  1. Put a RemoteService.cfc object at the root of your Model-Glue application that extends ModelGlue.gesture.remoting.AbstractRemotingService

  2. Edit the RemoteService.cfc and ensure the template value is set correctly

  3. Call the RemoteService from your Ajax or Flex client

Ajax Example

$.get("http://www.someapp.com/RemoteService.cfc", { name: "John", time: "2pm" } );

###Flex Example

<mx:RemoteObject id="mgrs"  
  destination="ColdFusion"  
  source="http://www.someapp.com/RemoteService.cfc"  
  result="resultHandler(event)"  
  showBusyCursor="true" />  

Now you can work with your data as you please in either type of client, Flex or HTML/Javascript.

Clone this wiki locally