Nitobi
About Nitobi
Services
Products
Home -> Blogs -> Dave Johnson

Dave Johnson

Archive for the 'RIA' Category

Hack Day Epilogue

October 21st, 2007

Nitobi Hack Day today was a great success! We had over 35 people in total throughout the day and ended up with about 8 or 10 presentations at the end of the day. Joe Bowser of Nitobi ended up being voted the coolest hack and won himself an shiny new iPod Nano. There was streaming video for most of the day and there will be videos put up on YouTube soon. Tweets can be seen from Andre, Brian, Roland and myself.

At the end of the day the keg of beer was tapped and there was a flury of activity as people tried to put the finishing touches on their applications.

Thanks to everyone who came out and made this event a very fun time! We will definitely be doing it again soon!

I will report on my Adobe AIR hack tomorrow once I get some much needed rest :)

Hack Day Eve

October 19th, 2007

Tomorrow is the day - first ever Nitobi Hack Day!

The details are now all set. Starting at 9am or whenever people can drag their asses out of bed, programmers and designers from around Metro Vancouver are gathering at the Nitobi world headquarters in Gastown for a day of hacking. After building some cool soft or hardware (and playing xbox / wii) we are going to gather at 5 to have some beer (a keg of local R&B Red Devil Pale Ale micro-brew) and pizza while people present their hack results. The favourite hacker will receive some sort of Apple hardware I believe and there are also some O’Reilly books + shirts to be given away.

A little birdie told me that their will be some iTunes AIR apps being built, some Wii controller robot hacking, and some free wireless hacking. You will have to stay tuned to hear about all the cool concoctions and there may even be a live video stream of the event over on ustream. Of course there will also be live tweets from at least myself, Andre and Brian.

After we will be retiring to one of the many great local pubs for a drink or two.

Hope to see you there!

Nitobi Hack Day Update

October 10th, 2007

Ok so we have some news. The nice folks over at O’Reilly have contributed some swag for people that attend hack day - this will most likely be given away as prizes. We are also trying to swing some more free stuff in the way of software and hopefully Andre will contribute some hardware for the best hack day app! We have also almost secured a keg of beer for those thirsty hackers and I will try my best to prevent it from being tapped until sometime in the afternoon just to keep the coding quality up to par :)

Just to be sure the day is Sat Oct 20 from 9am till whenever - we will likely go out for some drinks afterwards in Gastown and maybe even beyond.

Let us know you are coming (on facebook or upcoming) so that we reserve a spot for you in case there is no room on the day!

For those that don’t want to hack then at least come by to have a beer and say hi!

Dreamweaver IDE Support

July 21st, 2007

Mike has been at it again building some way cool tooling support around our components and screencasting about it! This time it is support for Dreamweaver.

Declarative Ajax and Flex Interop

July 3rd, 2007

This is some code that I wrote about a year ago at the Flex Component Developers Summit (and more recently presented at XTech) to show how declarative Ajax and Flex can work together to create dynamic, rich and compelling Internet applications.

The idea is simple. Take a single declaration - in this case XHTML - of some user-interface component and then use it to build a UI using either Ajax or Flex. All this from just one declaration.

What happens is that we take a single declarative data grid and converts it using XSLT on the client (so it only works Firefox, IE and soon Safari) into a declarative Nitobi Ajax Grid and to a Flex declarative MXML DataGrid. I use the FABridge to get the string of MXML generated from the XSL transformation into a stub Flex application where a Flex DataGrid is instantiated (deserialized) from the MXML declaration. It can an be seen live here (note: create the Flex grid first then the Ajax one - something funny that I can’t be bothered to fix ;) ) and the code can be downloaded from here.

So by using a declarative approach and a little XSLT on the client we were able to quickly choose between using a Flex DataGrid or a Nitobi Ajax Grid to display our tabular data in!

Really the most interesting part is the MXML deserialization stuff. The only contents of the Flex application are two functions for performing the deserialization. I have listed the main part of the code that takes an XML document of an MXML DataGrid declaration and actually instantiates a DataGrid according to that declaration. It’s pretty quick and dirty but at least gets the right thing out! Essentially it just looks at each XML element and creates an Object out of it and sets all the properties on it from the XML element attributes and then recurses through the child elements doing the same. There are some special attributes though like datasources that need a little more care.


public function initGrid(html) {
  // setup a tagname to datatype hash - maybe this already exists somewhere
  controls['DataGrid'] = 'mx.controls.DataGrid';
  controls['ArrayCollection'] = 'mx.collections.ArrayCollection';
  controls['Object'] = 'Object';
  controls['columns'] = 'Array';
  controls['DataGridColumn'] = 'mx.controls.dataGridClasses.DataGridColumn';

  // load the HTML into XML DOM
  var mxml:XML = new XML('<root>'+html+'</root>');

  parseXml(AjaxBox, mxml);
}

public function parseXml(parent, mxml) {
  var item:String;
  // get all the elements in our XML doc - this should of course walk the xml tree recursively
  var itemList:XMLList = mxml.elements('*');

  for (item in itemList) {
    // get the tag name of the XML node
    var tagName:String = itemList[item].localName();

    // get the class by using getDefinitionByName() method
    var ClassReference:Class = Class(getDefinitionByName(controls[tagName]));

    // create an instance of the class
    var myObject:Object = new ClassReference();

    // get all the attributes and set the properties
    var attrList:XMLList = XML(itemList[item]).attributes();
    for (var attr:String in attrList) {
      myObject[attrList[attr].localName()] = attrList[attr].toString();
    }

    // now parse the children of this node
    parseXml(myObject, itemList[item]);

    if (parent.hasOwnProperty(tagName)) {
      parent[tagName] = myObject;
    } else if (parent.hasOwnProperty("length")) {
      if (parent.hasOwnProperty("source")) {
        parent.source.push(myObject);
      } else {
        parent.push(myObject);
      }
    } else if (parent.hasOwnProperty("dataProvider") && tagName == "ArrayCollection") {
      // This means we need to create a datasource for the Grid
      parent.dataProvider = myObject;
    } else {
      parent.addChild(DisplayObject(myObject));
    }
  }
}

Nitobi Complete UI Beta 1

February 17th, 2007

Alright, we were supposed to have everything together and ready for full launch last Thursday but we came across a few difficult IE7 problems that has cause us to push back release by about 2 weeks.

However, we did release the beta 1 last night. There are still a few little bugs with the packaging and docs but for the most part the components are looking sweet! We got all the good stuff like:

  • Tree
  • Tab
  • Fisheye Menu
  • Callout
  • Ajax Toolkit
  • Grid
  • Combo

More info here.

All components are pretty much 100% client side with the exception of small server side components (ASP, CFM, PHP, JAVA, ASP.NET) that serve up the data. We are going to try and pack in one or two more features before release so speak up and let us know what you would like to see!

HTML Rendering Pains

January 30th, 2007

We had a recent project where a client was trying to render 150 columns and 100 rows in a Nitobi Grid. Now, to most people, this sort of use case may seem very strange, but in reality, rendering thousands of cells in a rich user interface is a regular occurance with our sort of customers. Due to these extreme requires of our users, for the most part I am _very_ happy we chose to implement our data rendering engine with XSLT rather than standard string building :)

However, this time we hit the wall and the application was dog slow. Even though we were using very fast XSLT to generate HTML from XML data which was then inserted into the document, we still ran into a big bottleneck using the HTMLElement.innerHTML property. The HTML structure was not that complicated to begin with. It was just some floated DIVs that made up the Grid rows / cells anas I started by just removing attributes until we got to the bare bones of the structure. Even then there were problems and the structure had to be changed completely.

In the end it was due to a mixture of three problems. Here is what we did to fix things:

  • Shortening the element IDs. With longer ID attributes on the HTML elements the browser was having a hard time processing them. This sped things up a little bit.
  • Used TABLEs elements for the structure. Changing from DIVs to TABLEs made a dramatic improvement of over one order of magnitude. The floated DIVs require a lot more processing on the part of the browser so that makes sense.
  • Removed inline events. Having inline events such as mouseover and mouseout specified on the HTML element was a bad idea. If we had tried to attach all the events through script we would have seen the same problem I am sure. The solution there was to assign more general event handlers higher up in the DOM hierarchy and let the events bubble up to a single handler. This improved the performance by almost another order of magnitude.

Things like the styling, number of classes or any additional custom attributes had pretty much no effect on the performance.

Podcasting Goodness

November 28th, 2006

After a bit of a hiatus we finally got back to recording some podcast action. We talked about frew things like the upcoming Nitobi rich UI AJAX suite and much more!

I also may have gone on a rant about something or other …

Podcasting with Coté

November 1st, 2006

We had a fun time yesterday shooting the shit with Coté discussing what is going on at Nitobi, OpenAjax Alliance happenings, RIA, the state of Ajax (always the innevitable topic) and the old Enterprise Ajax book - which is now ready for pre-sales :) - amongst several other things.

On another note - that whole JotSpot deal is pretty interesting :)

Ajax .NET Grid!

October 31st, 2006

We have finally made one more step on the path to getting our Ajax Grid control out there for .NET!

The Beta 2 has been officially released so go and try it out and let us know what you think!

You can also check out the demo here and it is looking pretty good!

For other perspectives check out the other blogs too: Alexei and Andre.


Search Posts

You are currently browsing the archives for the RIA category.

Pages

Archives

Categories

All contents are (c) Copyright 2006, Nitobi Software Inc. All rights Reserved
Dave Johnson Entries (RSS) and Comments (RSS).