structured omega

03 May

events support in HTML::Widget

written by Andreas Marienborg

at work I am fortunat enough to be able to work on a catalyst application, doing with it pretty much what I want. So I use DBIx::Class, HTML::Widget etc. Today however, I stepped on a stumbling block. There was no good way to add events to elements generated with HTML::Widget.

So I had to remedy that, and have started writing support for something along the following lines:

$element->events( onchange => "alert('event added with H::W')" );

it even supports using perl to generate the javascript:

$element->events( onchange => sub { my $element = shift; # return some JS };

Hopefully I will be able to finish of the patch tomorrow. For now its at http://home.palle.net/~omega/html-widget/events-support.patch

Feedback very much welcomed :)

The documentation has now been rolled into the same patch above.

Your captcha is:






Only the comment itself is required, but if you supply your email we'll gladly load your gravatar. We won't use your email for any other purpose or sell it to nigerian business men. Promise.
A live preview of your comment will appear in this box.