[Catalyst] Patch for HTML::Widget to ease addition of javascript events

Carl Franks fireartist at gmail.com
Mon May 8 16:03:06 CEST 2006


On 08/05/06, Andreas Marienborg <omega at palle.net> wrote:
> hms, its generated with svk push -P.
>
> the method adds is $element->events(onchange => "alert('etc')").
>
> to set attributes there is already support for I think, but this
> gives you the benefit of not putting events not supported by an
> element on that element.

Of course, $element->attributes({});
Sorry, mind slip!

I'm not keen on committing this myself - it seems like a lot of code
for a small benefit.
Rather than having so many new accessors, I'd rather have only
event(), and that should use $element->attributes->{$event} to store
the attributes.
But then you'd lose the benefits of $element->can($event).

This is rather academic anyway, as I don't use svk, and can't do
anything with the patch file.

Carl



More information about the Catalyst mailing list