As some of you may know, I've been working on refactoring FormUI.
As of now, I've completely rewritten the classes, and they seem fairly
ready for use.
I've updated a significant amount (but not all) of the documentation
here, down to but not including "Creating Your Own Validators":
http://wiki.habariproject.org/en/User:Ringmaster/FormUI
There are some exciting changes in several areas:
* Controls have been changed to use fallbacks, just like themes. As a
result, creating custom templates for controls should be much more familiar.
* Controls no longer have intrinsic labels. When creating a control, if
you want a label, you must explicitly create a label control to go with
it. This allows the control templates to include *only* what is
necessary to make the control work.
* Control constructors are now all identical. No more guessing what
parameters a control has in its constructor, because they're all the same.
* Fluent methods exist to set control-specific values, like the options
for a select control or the caption for a button. These explicit
methods are more clear, and the fluent interface makes them easy to use.
* It is now possible to register a form by name, and then create a form
using just the name. This is interesting because it allows a form to be
created and referenced separately from where it is used, aka "AJAX".
* Getting and processing of controls now happens separately. If you
assign a value to a control within the form generation, the value is
retained, which was not always the case before.
* All control values' save and load routines are now run through
ControlStorage (a FormStorage class).
* You can create forms with FormUI using HTML. You pass the HTML into a
method, and it just goes. This is new and prone to change, but pretty cool.
I'm gradually making my way through all of the forms, converting them to
the new methods. Every form I've come across so far has been
convertible, most of them have been simplified, and some of them have
done something simply that was ugly to do in the old version.
There are a lot of changes, and many changes yet to make to the existing
forms, but if you have a chance to look at the 388 branch and see what's
there (or maybe help convert the remaining unconverted forms), and make
comment, that could be very helpful.
Obviously, one of the things that this change doesn't address is that
the forms now look completely screwed up in the admin...
...and that's all I have to say about that.
But if you could have a look at what's going on in the code, and offer
any comment, that would be super-useful.
Thanks!
Owen