[Catalyst] html-widget bug or design?

Nilson Santos Figueiredo Junior acid06 at gmail.com
Wed Mar 1 16:04:11 CET 2006


On 3/1/06, Carl Franks <fireartist at gmail.com> wrote:
> There are a couple of behaviours I'm not keen on, are they intended,
> and would patches 'fixing' them be accepted?
>
> When I set an elements' value to zero, it's not set in the output xml.
>
> When I set an elements' label to the empty string, it's not set in the
> output xml.

I think these patches would probably be accepted. Either way, it seems
you'll need to modify the modules anyway. So you might as well just
send the patch to the authors.

> Also, I'd like an accessor to retrieve an element by name, so that I
> don't have to store them all as they're created.
> The elements are stored internally in html-widget as a list, meaning
> multiple items can share the same name.
> What would be the most sane behaviour of such an accessor?

I don't know exactly the innards of the modules you're talking about.
But the simple approach is to keep a hash along with the list. So
everytime you create an element, you add a corresponding entry in the
hash table. And so on. This could be made as a subclass of the module
or an actual patch which might be a nice feature (or not - depending
on the author's opinion).

-Nilson Santos F. Jr.



More information about the Catalyst mailing list