[Html-widget] opinions of removing implicit fieldset / breaking back-compat

Carl Franks fireartist at gmail.com
Thu Nov 9 09:30:31 GMT 2006


On 08/11/06, Andreas Marienborg <omega at palle.net> wrote:
> I think the idea of moving away from autocreating the container is
> probably a good idea.
>
> What I would like it to do is to refuse to add non-block elements
> directly to the form tag, so you ensure that they create the block
> themselves. That would also make it easier to find the places with
> missing containers as they would create deaths in tests.

This sounds the best course of action, but I'm think I'm at the stage
where I either need to release a HTML::Widget::Compat that people can
switch to when everything breaks - or create a fork under a different
name.

Not only will these changes break things for anyone using an implicit
sub-container, but removing the implicit sub-container will break
things for anyone using almost any $result method other than as_xml().
Unfortunately, $result->elements() has a hack for implicit
subcontainers, so that it returns the fieldset's elements.
Get rid of the implicit sub-container, and elements() just returns the
top-level fieldsets you've added. Making it recursive isn't much
better, as it doesn't just return form fields, but all types of
elements.
What's really needed is a fields() method that recursively returns all
form fields.

If things are going to be broken, I also want to incorporate the
changes to elements()/fields() I mentioned recently, so that they
return more helpful objects, rather than HTML::Element objects.

Rather than just start hacking, I'm going to edit the existing pod,
and make the files available somewhere online, so that everyone can
contribute to the design.
I'm also going to make sure that this goes through several cpan 'dev'
releases, so things are done right before committing to an API.

Carl



More information about the Html-widget mailing list