[Html-widget] HTML-FormFu example xhtml

Carl Franks fireartist at gmail.com
Mon Jan 22 09:21:20 GMT 2007


On 19/01/07, Mario Minati <mario at minati.de> wrote:
> Few questions:
> The radiogroup rg3 doesn't show labels for the subgroups. On purpose?

Well spotted!
I think I was going to make the label appear within a span with the
class-name "label".
RadioGroups having sub-groups wasn't really an intended feature - but
because they share the same baseclass as Select elements, I had to
make the RadioGroup template handle sub-group data, rather than choke
on it.
It's important that they can handle each other's data - the reason
they share a base class is so that you can do something like
[% result.field('my_select').as('RadioGroup') %]
in your template to cast between element types. You can also do the
same between different 'input' types.

> Why has the fieldset class in css a width of exactly 80%?

I just added that at the last minute, to make the form look a bit
better when it's on a page on it's own.
Widths wouldn't normally be included in the example css, as that's
more a 'style' issue that I expect would be different for each

> The way you provide of highlighting error elements is fine, might there
> be the possibility of setting a special class attribut for labels and/or
> elements that are required/have a special kind of constraint. What I
> mean is to set a css class based on the constraints of an element.

Because of the possibly large number of constraints any element might
have, I was planning on adding this as an optional feature.
Something like $form->constraint_classes() to add all constraints as
class names, along the lines of "required_constraint",
Or with arguments listing only the constraints for which class-names
should be added

> Can I reimplement the form module later on, so that I implement a
> special one for dojo with the use of formbind?

Not sure exactly what you're meaning.
As far as I can tell, FormBind only needs a javascript function
defined somewhere, and doesn't require any changes to the form markup.

Options for customisation include, being able to use a different
Render class which either completely replaces the rendering, or
subclasses what's already there so you can override as necessary.
A more simple approach would be to either use accessors to change
which template files are used, on an element-by-element basis, or
customise the template files, on a project-by-project basis.

Does that answer your question?


More information about the Html-widget mailing list