[Catalyst] Feature request HTML::Widget
Thomas Klausner
domm at cpan.org
Tue Jan 31 22:14:26 CET 2006
Hi!
I've got a feature request for HTML::Widget. I can send a patch, but I
want to check before I code for the trash bin...
>From time to time (or rather often) I need to do something with the
elements of a widget, after creating it. I.e. I have a $widget and want
to access all or some elements.
Currently the only way to do this seems to be to iterate of the ARRAYREF
returned by $w->{_elements}. Which means one has to directly access the
hash the $widget-object is based on. And to access 'private' data
(according to the underscore).
So I propse to add the following:
- a simple accessor 'get_elements' which returns the ARRAYREF
Additionally, I'd like to be able to get single elements by name.
like so: $widget->get_element('email');
To implement this, one would need to store the elements not only in
_elements, but also in a hash. And add some accessors.
This would result in some double assignments in HTML::Widget (but it are
only refs). OTOH, users of HTML::Widget wouldn't need to either drag the
hashref around on their own, or iterate over the list of elements just
to get one or two.
As I said, I can send patches etc, but I'll only write them after some
discussion/an OK by sri.
--
#!/usr/bin/perl http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}
More information about the Catalyst
mailing list