New XUL Demo

The demo is currently off-line while we upgrade this site.

I’ve set up a XUL Demo test app to illustrate the cross platform nature of the microshare project.

The demo is a simple example running a Pylons application which feeds XUL and RDF data to a Mozilla based web browser.

It was created as a proof of concept and to become familiar with writing Pylons applications and the various libraries and tools we are using in this project.

How it works

The web page at rio.microshare.net is a standard HTML page rendered by a Pylons application. It contains an embedded IFRAME that displays the XUL window. The XUL window contains a few lines of JavaScript and the layout of the window itself.

The window layout is written in XUL and consists of a tree control and a number of text fields. The tree control or list is populated by a separate controller which formats the data as RDF. This controller is called automatically by the datasource attribute of the tree control.

Clicking an entry in the tree control calls a JavaScript function that gets the record id of the currently selected tree item and sends it to another Pylons controller via XMLHttpRequest. The record is retrieved and returned to the request handler as json serialised data. The returned data is unpacked by another JavaScript function that populates the form fields below it.

It actually sounds more complicated than it is.