Skip to Navigation | Skip to Content



Archive for the 'Web2.0' Category

Enterprise Ajax Sample Chapters | March 15th, 2007

So I have finally gotten around to posting a sample chapter from the upcoming Enterprise Ajax tome written by yours truly along with Alexei and Andre. If you are so inclined you can even pre-order from Amazon to the right ->

The available chapters are number 3 - currently named Aajx in the Browser - and number 8 - currently named Ajax Usability. Chapter 3 is an overview of Ajax and how it relates to many of the traditional design patterns enterprise developers should be familiar with while chapter 8 covers usability issues and solutions. Without further ado, here is chapter 3 and here is chapter 8.

Please post any comments / questions if there is anything that needs revising or is missing.

Posted in AJAX, Nitobi, Web2.0, enterpriseajax | 4 Comments » | Add to Delicious | Digg It

XTech 2007 - Declarative Progamming | March 11th, 2007

It looks like I will be in Paris to give a presentation at XTech 2007 (May 15-18).

I will be talking about declarative approaches to Ajax and looking at some of the important cross browser issues that may be encountered. I will also give a quick high level overview of some of the important declarative languages that we can use for guidance and inspiration.

Ping me if you will be in Paris during that time - I will also be spending a little time in London around then as well.

Posted in AJAX, Conference, Declarative Programming, Nitobi, Web2.0, xtech | 1 Comment » | Add to Delicious | Digg It

Flickr Login | February 17th, 2007

So how many people are going to keep using Flickr in the face of a forced migration to a Yahoo! ID?

Posted in Flickr, Web2.0 | 1 Comment » | Add to Delicious | Digg It

Ajax Deleting | January 25th, 2007

The topic of this post is about deletion using Ajax. Truth be told, it’s not really even about Ajax but about the deletion pattern and related user experience in general.

So often it is the case that when a person deletes some data - like a photo tag in Flickr for example - the application insists on confirming that the user really wants to delete the item. This kind of interaction is really annoying when you are deleting several items from a list or even just one when you are a “power user”. In fact, more often than not, the user wants the delete to occur immediately and requires no confirmation. The confirmation dialog is just an over-engineered catch all for those rare cases when the user presses the delete button in error. In the case of Flickr photo tags then who even cares if you accidentally delete one tag?

There are a few good options for Ajax delete that I think one consider when building data intensive web applications.

  • Make the delete button smaller but communicate its meaning more clearly.
    Using large and unfamiliar buttons for signifying a delete action makes it easier for a person to make a mistake - thus re-inforcing the need for a confirmation dialog. A smaller button means the user has to work a little harder to perform the delete operation, but not quite as hard as confirming the delete, and the more clear the button is for deleting (through a tooltip or whatever) then the fewer inadvertent deletes there will be.
  • Store all deleted data the client before executing the deletes.
    Although it could be a good option, the previous suggestion still provided no way to undo a delete. To that end, rather than having a difficult confirm dialogue the developer can take a different approach to deletions such as batch deletions with a single confirm dialogue or even an easy way to roll back the deletes if they are in error. I imagine the reason for using a confirm dialogue is because it is easiest for the developer, but certainly not the user.
  • Use a timer on the delete action giving the user the opportunity to cancel the delete.
    Finally, an approach that could encompass both of the previous suggestions would be a delete timer. This would be an animation to indicate that the item is pending a delete in say 5 seconds. The key here is that this is ample time for the user to cancel the delete if they want but otherwise the deletion will continue if the user does not take any action to prevent the delete from happening.

At any rate, this is one area where most web application fail miserably and there are great advances to be made with Ajax based applications.

Posted in AJAX, DHTML, JavaScript, Web, Web2.0 | 6 Comments » | Add to Delicious | Digg It

Nitobi Ajax Framework | December 12th, 2006

It has been a while since any serious blogging has taken place but I think that I should get some in over the upcoming holidays. Also, we have been very busy getting the final touches on Enterprise Ajax and getting started on new development plans.

As some will know from listening to the Nitobi podcast, we are currently building some new components such as a Tab, Tree and a Date Picker. For the start they will be fairly standard Ajax components but we have some cool new ideas for old patterns that should make some waves in the Ajax user-interface space.

At any rate, one of the first parts of our yet to be named Ajax user interface suite is going to be the Framework. The Framework is going to be where all the nuts and bolts are located that allow developers to build their own Ajax solutions using both our basic cross browser libraries as well as our component architecture.

For the most part, the Framework will have some important features such as:

  • XMLHttpRequest (Throttling, polling, timeout, events etc)
  • DOM Events
  • JavaScript Events (MVC)
  • DataSet / DataTable (ActiveRecord)
  • Object Serialization (XML and JSON)
  • Declaration Parsing
  • Back Button History
  • OOP Inheritance, Interfaces and Garbage Collection
  • Effects
  • Drag + Drop
  • Cross Browser HTML and DOM
  • Cross Browser CSS
  • Cross Browser XML

While many are similar to those things found in other frameworks out there (like the DOM events), we are keen to hear both what people think is lacking in other frameworks and what is a must have.

I am most excited about the serialization and declartive component stuff myself. It should really help developers build their own declarative components really easily.

One final note is that the Framework will be included in the suite but other than that we are not too sure what to do. Any ideas or comments on if, when, and how we might open source the Framework code would be more than welcome! :)

Oh crap, one more thing. What is important to people for a cross browser XHR object? What’s missing? I think that comet, throttling, timeouts and better events are a good start but what do you think? As the pipe gets bigger and more action is happening on the client we are thinking a lot about how the data is flowing from the server and how it gets handled by the client.

Posted in Conference, Copyright, Energy, JavaScript, Patterns, Uncategorized, Web2.0, XML | No Comments » | Add to Delicious | Digg It

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 :)

Posted in AJAX, Google, Podcast, RIA, Redmonk, Web2.0 | No Comments » | Add to Delicious | Digg It

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.

Posted in AJAX, RIA, Web2.0, asp.net | No Comments » | Add to Delicious | Digg It

Flex Ajax Dashboard | October 17th, 2006

We have just made a quick Flex/Ajax dashboard to show how Flex and Ajax can work together to make a very compelling user-interface for something like a corporate information dashboard. You can check it out the demo here and an article about the demo here.

Using the FABridge along with the Nitobi Ajax Grid and Adobe Flex Charting, we have created a scenario where one can view monthly sales data and then see the sales details for the month in both a tabular format in a grid and visually represented in a Flex chart.

Under the hood we have used PHP and MySQL to provide the data to both the data grids and the chart. When a user clicks on a record in the sales data grouped by month, the details grid makes a request to the server for all the sales data for that month - this ends up being between 200 to 1000 records or so. To ensure that the details grid is still fast, we only render the part of the dataset that the user is looking at rather than rendering all 1000 records say, which can take a long time when you use the DOM innerHTML property. The other thing that happens when a month is selected in the master grid is that the Flex chart is also updated with information about the sales for that month, except that the sales data is then grouped by day. Grouping of the sales data could either be done on the client or the server, however, since we have already retreived all the sales data for the month and displayed it in the detail grid we simply take that same data and group it very quickly using an XSL transformation (yes currently only IE and Moz but the latest Safari build also has it - finally!). The grouped data we output from the XSL transformation is actually formatted as JSON which is then evaluated into a JavaScript object and passed to the Flex chart for rendering. The grouping XSLT is pretty simple and uses the Muenchian method:

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ntb="http://www.nitobi.com">
  <xsl:output method="text" encoding="utf-8"/>
  <xsl:key name="sales-by-day" match="ntb:e" use="@h" />
  <xsl:template match="/">
    [<xsl:apply-templates select="//ntb:data" />{}]
  </xsl:template>
  <xsl:template match="ntb:data">
    <xsl:for-each select="ntb:e[count(. | key('sales-by-day', @h)[1]) = 1]">
      {'totalSales': <xsl:value-of select="sum(key('sales-by-day', @h)/@i)"/>,
        'day': <xsl:value-of select="@h" />,
        'month': <xsl:value-of select="@f" />,
        'year': <xsl:value-of select="@g" />},
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

We have also hooked up a few other events so that the chart will be updated when changes to the data in the detail grid are made.

All in all, by using the FABridge to move data to and from a Flex chart we can create very compelling and ultimately very useful dashboard type of application by merrying the Flex and Ajax technologies.

Posted in AJAX, Components, Declarative Programming, Flex, Nitobi, RIA, Web2.0 | 12 Comments » | Add to Delicious | Digg It

Declarative AJAX Components and XML Namespaces | October 16th, 2006

Being on the OpenAjax committee has been pretty interesting so far despite the fact that I have only managed to be in on one call - luckily all the minutes are on the wiki and I have been following that pretty intently.

The declarative markup comittee is looking at how to standardize the definition and instantiation of declarative AJAX components or widgets. A good example of a complex component is the Nitobi Ajax Grid component while the Dojo framework has several smaller widgets like the very cool fisheye menu. To create an Ajax widget in a web page declaratively one might have some markup like this:

<ntb:grid ... />

Similarly, one could use something like this:

<div oatype="ntb:grid" ... />

This is very similar to the idea of microformats - and even makes them more expressive. In either case the OpenAjax bootstrapper would start using something like the onload event on the window object and it would search through the DOM and find all elements with a custom namespace or an oatype attribute. Once the bootstrapper finds a component declaration it refers to a registry to find the toolkit that is responsible for parsing and loading that specific component from the declaration. Personally, I like the former with the custom tag that is properly namespaced.

Unfortunately, IMHO, people generally opt for the later declaration that uses the build in HTML elements and simply adds custom attributes. While both are nearly identical, the use of namespace prefixes on the tags is possibly more “standard” and ensures that one doesn’t get a Grid component mixed up with a regular DIV element. For the most part, I think the gravitation towards the later declaration is due to the general contempt people hold for Internet Explorer - and indeed most of the people on the declarative markup committee feel this way. Having been building declarative components for Internet Explorer for over six years now we are pretty well versed in the problems with Internet Explorer, and I can assure you that the support for XML namespaces and custom tags in Internet Explorer is perfectly fine. I would argue, as you will see in a moment, that the support is even better in Internet Explorer than in Mozilla. Some Ajax frameworks, such as Dojo, support XML namespaces in Mozilla but not in IE due to perceived deficiencies.

From our experience, Firefox and not Internet Explorer has been the browser that breaks when custom namespaced tags are used. The biggest hurdle is that, as noted in the Dojo manual page that, one “must” (emphasis on the part of the author of the Dojo manual) define the xmlns:mynamespace on the page. Usually that is done on the HTML tag. Anyone that has worked with XML will surely know that if you want to have some elements in a different namespace then declaring that namespace is a fact of life. On the other hand, Firefox works in a quirky way if you define custom XML namespaced tags - forgetting the fact that it doesn’t even care if you define the namespace or not, which seems very bizarre to anyone familiar with XML. For the straight dope on custom tags in IE everyone should check out the relevant MSDN article (it is amazing all the good stuff on MSDN that many people ignore). The jist of the article is that you just need to specify your XML namespace on the HTML element like this:

<html xmlns:mynamespace>

How completely unexpected! However, it can also be specified on any other element that is a parent of an element that uses the namespace. The article describes the fact that support for custom tags was introduced for enabling behaviours - ie defining custom HTML elements that behave in some custom way - which were a great idea. Admitedly, the one drawback of the IE model is that it does not support the document.getElementsByTagNameNS() method, which can select tags with a namespace in Firefox. Instead one has to use the regular getElementsByTagName method and look at the namespace value. This is easily wrapped of course.

Having said all this, one should also remember that XHTML is not really there yet.

At any rate, we still want to use XML namespaced tags and there are a few problems we have found with Firefox regarding support for custom XML namespaced elements. The two main problems we have observed are:

      Styles are not applied correctly
      DOM methods do not work correctly
      Self closing tags do not work

To illustrate this, I have made a simple example with some sample markup that might be used in some sort of windowing or panelling situation. I defined some buttons, panels and a title with some interspersed native HTML elements.


<div id="div1">
  <ntb:button id="button1">button 1</ntb:button>
  <ntb:button id="button2">button 2</ntb:button>
  <ntb:panel id="panel1">
    <ntb:title id="title1">
      <div id="div2">panel title 1</div>
    </ntb:title>
    <ntb:contents id="contents1">
      <div id="div3">Contents div3</div>
      <div id="div4">Contents div4</div>
    </ntb:contents>
  </ntb:panel>
</div>

One common thing to do is define some custom styles for these elements such as this:

ntb\:panel {border:1px solid red;display:block;}
ntb\:contents {color:red;display:block;}
ntb\:title {border:1px solid black;background-color:#3366FF;display:block;}
ntb\:button {border:1px solid black;background-color:#CCCCCC;}

The results are fairly good in IE:

ie namespace formatting

and pretty poor in Mozilla:

firefox namespace formatting

Granted that is quite contrived and the likelyhood of specifying styles for the custom elements is pretty low.

This brings us to the second point which is a bit more important. The native DOM methods in Mozilla don’t actually recognize the custom elements; or rather, to be more precise, DOM methods don’t reflect the true DOM hierarchy as it appears in your HTML. As an example, we will try and access the parent node of each of the nodes in our sample custom namespaced HTML. The results were as follows:

IE parentNode()

Target Node ID Expected Parent ID Actual Parent ID
title1 title1 title1
contents1 contents1 contents1
ok you get the idea

Mozilla parentNode()

Target Node ID Expected Parent ID Actual Parent ID
div2 title1 div1
div3 contents1 div1
div4 contents1 div1
button1 div1 div1
button2 div1 div1
panel1 div1 div1
title1 panel1 panel1
contents1 panel1 div1

Internet Explorer gets the parentNode as one would expect but Mozilla seems to have some difficulty. There are similar difficulties with many other of the DOM methods in Mozilla.

The big problem we have found is that Mozilla does not support self closing tags. One would expect that the following would be equivalent:

<ntb:grid />
<ntb:grid></ntb:grid>

Not so in Mozilla. The later syntax is ok, whereas the self closing tag does not get parsed correctly when you look at the innerHTML of an element and it is even worse once you have self closing tags in conjunction with DOM methods.

Mozilla has to get its act together with custom namespaced tags for declarative AJAX components to ever get anywhere. If anyone wants to compare war stories then please leave some comments.

Technorati tags:ajax, microformat, declarative, components, xml

Posted in AJAX, Components, Declarative Programming, Microformat, Web2.0, XML | 14 Comments » | Add to Delicious | Digg It

AjaxWorld | October 3rd, 2006

Andre and I made it safe and sound down to Santa Clara for AjaxWorld. If you are in the neighbourhood give us a shout!

Posted in AJAX, Conference, JavaScript, Web, Web2.0 | No Comments » | Add to Delicious | Digg It


Search Posts

You are currently browsing the archives for the Web2.0 category.

Archives

Categories