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

Carl Franks fireartist at gmail.com
Thu Nov 9 12:18:08 GMT 2006


On 09/11/06, Andreas Marienborg <omega at palle.net> wrote:
> I think a fork might be the right thing to do, so people can continue
> using HTML::Widget as it is now, as a simple way to create simple forms.
>
> The new project sounds more like a way to specify more complex
> structures than just forms? In that essence a new namespace might be
> appropriate, I just dont know what it should be.

I've experimented with creating a HTML::Widget::Compat using the same
techinique as Class::DBI::Frozen::301 used, and it works fine.
All you need to change is the "use HTML::Widget;" to "use
HTML::Widget::Compat;" and everything else works as before.

Yes, one problem is the ridiculously full HTML/Form namespace, which
is why I'd like to stick with HTML::Widget if possible, rather than
make up yet-another-meaningless-name.
Another reason is that there are several parts of the current H-W
which are currently broken, which can't really be fixed.
If you're adding nested blocks, then $result->element() is useless.
Doing anything with $result other than as_xml() is far harder than it's worth.
But changing either of these would break existing apps anyway.
So I'm not keen on leaving H-W as is, when new users will keep trying
to use it for things that we can implement better.
I guess an alternative - and only if someone comes up with a fantastic
new name - would be to change the H-W docs to suggest using the new
module, and make it clear that someone will have to take it over for
anything other than bugfixes to be made to it.
My likely vote though, will be to release H-W-Compat, advertise it so
people can make the change with plenty of time before H-W breaks, and
only make dev releases of the new code until we're happy with it.

> Some things I wish could happen in the new one:
>
> - A way to get the element for the label.

Sorry, I'm maybe being stupid, but I'm not sure what you mean.
A code / template example would help.

> - A simpler way to combine elemnts, so I dont have to keep writing
> theese "TextfieldButton", "TextfieldSpan" classes.

Good idea, though error handling will have to be taken into consideration.
Can you send me the code from those type of classes you've previously
made, so I can see exactly what you've done?

> - Shorter classes on the elements, and instead more classes for each
> element

Again, I'm not quite sure what you mean.

> - Formated output by default.

Yes, though a goal will be to be able to pick different renderers, so
changing it should be simple.
Unfortunately HTML::Element's as_XML output can't add formatting, only
the as_HTML output.
I've not compared the difference between the output of the two
methods, but their code is certainly completely different.

Carl



More information about the Html-widget mailing list