ColdBox AjaxCFC example

Is there an example of AjaxCFC & ColdBox together?

I'm not really sure how bridge the gap between the ColdBox Reader and
how I'm used to using AjaxCFC.

This is how I'm used to doing it...

function myFunction() {
  var _o = {
  "myVar1" : "myVal1",
  "myVar2" : "myVal2"
  };
  $.AjaxCFC({
    url: "model/cfc.cfc",
    method: "myMethod",
    data: _o,
    success: function(data){
      $.taconite(data);
    }
  });
return false;
};

Also would I no longer need Taconite?

Hi

have look into this
http://ortus.svnrepository.com/coldbox/trac.cgi/browser/coldbox/trunk/samples/applications/ColdboxFlexTester/webroot/coldboxproxy.cfc

url: “model/cfc.cfc” ====== url: “coldboxproxy.cfc”,
method: “myMethod”, ======= method: “ehMain.getUserXmlFormat”

setview(“UserXmlFormat”,true); this will retrun xml format without having further layout.
http://www.coldboxframework.com/documents/cfdocs/templates/content.cfm?file=C%3A%5CInetpub%5Cvhosts%5Ccoldboxframework%2Ecom%5Chttpdocs%5Cbuilds%5Ccoldbox%5F2%5F5%5F0%5Ccoldbox%5Csystem%5Cbeans%5CrequestContext%2Ecfc

Does this make sense.

Regards
Sana

Are you saying that I'll be calling 'coldboxproxy.cfc' as the
component for all my ajax requests? (Really?)
And that I can just call a normal event handler in the framework?
(That sounds right)
And that the '_o' variable will end up in the request collection?
(hmmm...)

No, I really don't think I understand.

Hi

Its really surprising that coldbox support FLEX/AIR/AJAX in a same way of normal event life cycle.

do a alert(_o);

what you will see the values from coldbox.

second step to fire existing events

<cfset results = super.process(argumentCollection=arguments)>

as I said setView(“your view which generate string/xml/json”, true);

Now Coldbox really rocks

Thanks

Sana has it right,
You can bind calls to the proxy and treat them as normal events in the back end.

You would hit the proxy and call the process method on it, and passing the event variable and any other variables your event can use for processing. Then the handler can return values or if the “ProxyReturnCollection” setting is set to true, it will return the request collection structure. If not, just return what you need from the handlers.

You might also want to consider building a UI plugin for your JS and CSS. Then you can do something like the following in a layout or view:

#getMyplugin("myUI").renderJS('formElements')#

or

#getMyPlugin("myUI").renderJS("draggables")#

Then your custom plugin encapsulates the JS. Try that.

LUis

Where does ajaxCFC fit in?

I usually extend the AjaxCFC framework by...
<cfcomponent name="AjaxUtils" output="false"
extends="model.com.ajax.ajax">

Now we have...
<cfcomponent name="coldboxproxy" output="false" extends="
coldbox.system.extras.ColdboxProxy">

By the way, 'coldbox/system/extras/coldboxproxy.cfc' does not exist in
the download package? Is this intentional?

Are you downloading 2.0.3 or 2.5.0 beta?

2.5

Hi,

it should be there, but anyway would you like to download latest code-base.

Nighly Build Download: http://www.coldboxframework.com/downloads/nightlybuild/coldboxNB.zip

SVN:

http://ortus.svnrepository.com/svn/coldbox/coldbox/trunk

username: nightlybuild
pass: nightlybuild

thanks

Thanks a lot sana ... I still don't understand where AjaxCFC fits in,
or if you really even need it.

Hi,

I am checking AjaxCFC now… please be patience with me… i am modify this will have all coldbox event-model.

At the moment I am using Jquery+AjaxCFC …
http://www.ajaxcfc.com/trac/browser/branches/jquery/core/ajax.cfc

My new ajaxproxy will be modified form of above ajax.cfc.

Please let me know if you happy then I will post new ajaxproxy based on AjaxCFC

Even you can catch me gmail talk.

Thanks
Sana

I am also using AjaxCFC + jQuery ...
http://www.ajaxcfc.com/trac/browser/branches/jquery/core/ajax.cfc

Thomas

Hi,

I have build a new ajaxproxy.cfc from ajaxCFC, at the moment I am testing it. I will post it soon.

Thanks
Sana

Hi,

I have attached the new ajaxproxy sample.

Just drop ajaxcfc folder under your webroot and thats it.

Its a port of ajaxCFC, please have a try, I will try to add more examples from ajaxCFC.

Thanks
Sana

ajaxcfc.zip (87.1 KB)

Sana, I will review the app, but I can see already some problems with it. I will add it to the SVN probably tomorrow so we can start versioning the sample application. But GREAT WORK on this. I will also get Rob to take a look at it.

Luis

Luis,

It was quick from my end…

I will send over more cleaned up version and more samples.

Thanks
Sana

Thanks you guys, all this is really useful for me :wink: