[Catalyst] html-widget bug or design?

Sebastian Riedel sri at oook.de
Wed Mar 1 17:00:16 CET 2006


Am 01.03.2006 um 16:04 schrieb Nilson Santos Figueiredo Junior:

> 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.

Yes, thats considered a bug.

>
>> 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).

A hash would solve nothing, we have to use a list because multiple  
elements with the same name are valid.
I would call the methods get_elements/get_constraints/get_filters and  
just let them return a list.

Patches welcome! :)


--
sebastian




More information about the Catalyst mailing list