Hi Martin,
That's a great idea. In fact we are currently working on the next generation of web applications, and in those apps it will be a lot easier to add event handlers to widgets and even run code on the client-side. Expect some good news about this in the next few months.
Thanks,
Tiago Simões