[Html-widget] Creating separate fieldsets in a form
bogdan at wiz.ro
Tue Aug 29 11:16:16 CEST 2006
On Tue, 2006-08-29 at 08:39 +0100, Michael Gray wrote:
> On Mon, 28 Aug 2006, A. Pagaltzis wrote:
> > FWIW, Michael Gray is currently working on a large patch to
> > refactor the rather… unfortunate set of design choices which led
> > to this limitation. One of the next versions of H::W will support
> > nesting fieldsets arbitrarily.
> Yup, sorry I meant to reply to the original poster but ran out of time.
> The SVN version at http://oook.de/svn/trunk/HTML-Widget has this
> support, see t/element_block.t and t/09nested_embed.t.
I'm using trunk with the new updates, they seem to work very nice (for
my needs anyway :) ).
I noticed these (not very important) problems though:
the fact that an id is always generated, although I rarely need an id,
so the DOM namespace gets severly poluted with useless ids:
(real life example)
I know this is mostly a container problem, but now with the nested
fieldsets the ids can get quite long and redundant.
2. Most forms look like this: (a main fieldset, containing several small
fieldsets with inputs and a final submit button)
Whenever I add a fieldset element in the widget, it is rendered directly
as <form> children. But if I add a non-fieldset element, a fieldset is
automatically created to hold it (default behaviour in the earlier
version) , but the other fieldsets don't get embedded in this automatic
main fieldset, but go right under it. So the result is something like:
<fieldset> (the autogenerated one)
<fieldset> (personal data)
This is very simply corrected if I add the main fieldset manually, and
put the other fieldsets and the submit button in it.
the obvious bugfix is to render the elements in the order they were
added (don't put the submit button on top if it was added after those
Besides that, a DWIM behaviour (for me anyway) would be these elements
should be syblings in the DOM Tree:
I don't know if it was clear enough, I can write a test if needed.
Bogdan Lucaciu <bogdan at wiz.ro>
More information about the Html-widget