Netvibes UWA, BIBSYS and Javascript


You’re no doubt aware of Netvibes, it’s a user community based around a widget-based personal startpage. It also has the possibility of providing public pages based on widget content. In many ways, it has a lot in common with iGoogle and Pageflakes.

I’ve been working quite a lot with Netvibes recently, mainly because it has a good API called the Universal Widget API (or UWA for short). The UWA makes Netvibes widgets portable to aomong other things iGoogle and Mac OS X Dashboard.

I wrote a UWA widget for our OPAC, BIBSYS Ask, which has some amusing features, including AJAX requests and fielded search for a course we were holding.

The widget now seems to be working fine on all the relevant platforms, but this was no simple task because of one thing: inline events.

What’s an inline event? Well, it’s when you connect an HTML element in the interface to a specific event and result. An example here is saying that when button X is clicked, display the text “hello!”. Netvibes UWA widgets don’t like it when you connect these pieces together directly; the crrect way of doing this is “dynamically”. By dynamic, I mean when the page is loaded, the elements are added and the events are assigned to elements in the interface as a secondary procedure.

There are quite a few software libraries out there that provide support for dynamic assignation of events to elements in the interface, one of these is behaviour.js, another is dojo.behavior; both of these libraries function well in their context. dojo.behavior (based as it is on behaviour.js) has the edge because it only assigns the events once to each element (which means the events can be applied as needed in a dynamic interface). Only problem is that Netvibes doesn’t really do external Javascript files.

So, after a lot of messing about, I reached the conclusion that I really was going to have to do things as described in the UWA documentation. Silly me.

Anyway, it works now.šŸ™‚

Tags: , ,

%d bloggers like this: