Results 1 to 7 of 7

Thread: Does extjs support Bayeux comet?

  1. #1

    Question Does extjs support Bayeux comet?

    And how?

  2. #2
    Sencha User xantus's Avatar
    Join Date
    Aug 2007
    Location
    Seattle, WA
    Posts
    135

    Default

    Hi

    I co-authored the bayeux protocol, but I haven't written a bayeux library for Ext JS yet. I've been focusing on HTML5 mostly. (websockets, audio, video, etc)

    The cometd library was rewritten back in May to support multiple frameworks, but no one that I know of has written an Ext adapter. (There is a jquery and dojo adapter)

    It shouldn't take much to attach the extjs methods into the cometd common library...if you want to take a stab at it:

    Common JS
    http://svn.cometd.com/trunk/cometd-j...in/webapp/org/

    You can use these as a reference

    jquery adapter
    http://svn.cometd.com/trunk/cometd-j...webapp/jquery/
    Dojo adapter
    http://svn.cometd.com/trunk/cometd-j.../webapp/dojox/

    Relevant thread on the cometd-dev group:
    http://groups.google.com/group/comet...fb1346570f292c

    HTH
    ? Software Engineer
    http://xant.us/

  3. #3

    Default

    I see

    I have to figure out some other way to fulfill my task.

  4. #4

    Default

    I happen to see that Extjs has JQuery adapter,maybe...
    I'll have a try.

  5. #5
    Ext JS Premium Member
    Join Date
    May 2007
    Location
    Aalborg, Denmark
    Posts
    16

    Default

    I started this ExtJs wrapper for the new version 1.0 of comet, but had to give it up and return to the old version shipped with dojo, simply because they had changed too much. But you are welcome to use the code as inspiration for a real ExtJs wrapper.

    Code:
    // Remap cometd JSON functions to Ext JSON functions
    org.cometd.JSON.toJSON = Ext.util.JSON.encode;
    org.cometd.JSON.fromJSON = Ext.util.JSON.decode;
    
    // The default cometd instance
    Ext.ux.Cometd = new org.cometd.Cometd();
    
    // Remap toolkit-specific transport calls
    Ext.ux.Cometd.LongPollingTransport = function()
    {
       this.xhrSend = function(packet)
       {
          var xhr = Ext.Ajax.request({
             url: packet.url,
             method: 'POST',
             success: function(response, options)
             {
                packet.onSuccess(response.responseText);
             },
             failure: packet.onError,
             headers: packet.headers,
             jsonData: packet.body
          });
    
          return ({
             abort: function()
             {
                Ext.Ajax.abort(xhr);
             }
          });
       };
       
    };
    Ext.ux.Cometd.LongPollingTransport.prototype = new org.cometd.LongPollingTransport();
    Ext.ux.Cometd.LongPollingTransport.prototype.constructor = dojox.cometd.LongPollingTransport;
    
    Ext.ux.Cometd.registerTransport('long-polling', new Ext.ux.Cometd.LongPollingTransport());

  6. #6
    Touch Premium Member
    Join Date
    Apr 2007
    Posts
    139

    Default

    FWIW: Burke Webster has published an Ext extension to the cometd.js library. http://code.google.com/p/ext-cometd/
    HTC Desire - Android: 2.2 - Kernel: 2.6.32.15-gf5a401c - Build: 2.29.405.2 - WebKit: 3.1

  7. #7
    Sencha User daubman's Avatar
    Join Date
    Jul 2010
    Location
    Massachusetts
    Posts
    34

    Question Ext JS 4 version?

    Any update on whether this will make it to Ext JS 4? Looking to leverage CometD in an Ext JS 4 app...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •