cfajaxproxy

Creates a JavaScript proxy for a ColdFusion component, for use in an AJAX client.

  <cfajaxproxy>

 cfajaxproxy();

Attribute Reference

cfc string

The CFC for which to create a proxy. You must specify a dot-delimited path to the CFC.
The path can be absolute or relative to location of the CFML page.
For example, if the myCFC CFC is in the cfcs subdirectory of the ColdFusion page, specify cfcs.myCFC.
On UNIX based systems, the tag searches first for a file who's name or path corresponds to the specified name or path, but is in all lower case.
If it does not find it, ColdFusion then searches for a file name or path that corresponds to the attribute value exactly, with identical character casing. (required)

jsclassname string

The name to use for the JavaScript proxy class. (optional)

bind string

A bind expression that specifies a CFC method, JavaScript function, or URL to call.

onerror string

The name of a JavaScript function to invoke when a bind, specified by the bind attribute fails. The function must take two arguments: an error code and an error message.

onsuccess string

The name of a JavaScript function to invoke when a bind, specified by the bind attribute succeeds. The function must take one argument, the bind function return value. If the bind function is a CFC function, the return value is automatically converted to a JavaScript variable before being passed to the onSuccess function.

Examples
Sample code using the cfajaxproxy tag

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub