Choosing a direction for Rich Internet Applications

Currently we’re at the point of a big shift/hype of (Web) Application Development. The development of Rich Internet Applications. (RIA). A RIA is an application that runs via the web, probably via a webbrowser though this isn’t a requirement.
The idea is that RIA makes this application work like a local desktop application. This could mean the application should be capable of running offline and online.

There are severy solutions for this purpose:

  • Ajax Based ~ This is wat I’m used to, but it has it’s limitations.
  • Google Gears ~ Browser Plugin Based. Look Nice, browser plugin offline application use
  • Adobe FLEX/Flash ~ Via the Flash plugin that’s installed on almost every PC
  • Adobe Air ~ To run applications from the desktop
  • Microsoft Silverlight ~ Microsoft attempt to join the club
  • JavaFX ~ Beta, Looks nice. unfortunally I’m not a big fan of the large overhead the Java plugin has.
  • Ajax isn’t an ideal solution because it never gives me access to the local user’s PC and doesn’t work offline.

    Now is my Problem, what direction should I choose?! Staying with Ajax for now seems like a safe choice, because it will run probably on the most platforms..

    This is something that requires some good Research!

    Closing an IE popup two times while busy with Ajax request hangs IE

    Closing an IE popup (twice) while a XmlHttpRequest is running, uses up all available connections.

    To reproduce this:
    – create a slow XmlHttpRequest (xhr). (Running about a minute or so)
    – Open a popup window which executes this xhr. Close it while it’s still running
    – Open this same popup again. (Second request). Directly close it while the xhr is running.
    – Open another popup… et voila… IE Hangs..

    This problem is what I was experiencing. After hours of frustrations we found a workaround:
    In the onunload of the body tag you must call the “open” method on the same XmlHttpRequest object.
    The call of “open” disconnects and stops the old request. Appearently abort doesn’t do this

    Working code:










    WARNING: This solution has only be tested with IE7!

    Update 23-01-2008:

    Solution for this problem with prototype is. Just put this code in an seperate javascript file. Include this file after prototype.js call iefix_runGarbageControl() in the onunload and the bug is fixed ;-)


    // IE TCP/IP Connection Leak FIX, with prototype
    if( Prototype.Browser.IE )
    {
    var iefix_xhrs = new Array();
    function iefix_runGarbageControl() {
    for(var i=0; i

    Update 24-04-2008:
    Added: place 'iefix_runGarbageControl()' in the onunload

    Prototype automatic Spinner

    I found the following code on the internet. By using this code, a spinner is showed automaticly if an Ajax request is running. Very nice!

    // registreer een algemene spinner
    Ajax.Responders.register({
      onCreate: function() {
      if (Ajax.activeRequestCount > 0)
        Element.show('spinner');
      },
      onComplete: function() {
      if (Ajax.activeRequestCount == 0)
        Element.hide('spinner');
      }
    });
    

    Didn’t know prototype had this global register method. I should take a better look at the API!

    Ajax Table Paginated Sortable and Searchable

    Currently I’m working on an application for a client. It’s build in Ruby on Rails. After using ActiveScaffold for the startup I’ve decided to remove this plugin and write my own Ajax table.

    I found a nice article / sample about this subject: http://dev.nozav.org/rails_ajax_table.html

    The article is nice for a single table, but I need multiple tables, so I need to wrap some stuff in helpers. But that shouldn’t be a problem.