What are FormWidgets ?
FormWidgets are XUL Elements that implement
harvest
and seed
as explained in the
chapter harvest and seed. This means
they can translate their state into (one or more) name/value/label triplets,
and be initialized by such triplets.
The FormButton addon
uses harvest
on a nested group of widgets to create
HTTP/CGI queries and execute them.
It can also
use seed
to initialize such groups of widgets.
The WidgetTree addon allows you to edit the contents
of a treecell in a tree by doubleclicking on it. It only works for
contenttrees.
Who needs FormWidgets ?
Nobody :) but it might be usefull for
- XUL developers who need to generate CGI querys from XUL,
for example in 'remote' applications using dynamically generated XUL
- Intranet developers who are looking for the functionality of
htmlforms with the richness of XUL widgets
- Anyone who wants a persistent javascript interface for the
myriad of XUL widgets
Roadmap
I've been coding more than I've been able to test. So there are bugs.
Most code is pretty simple, and most bugs will just be typoos, please let
me know and I'll fix them in due time.
- rework all elements to harvest/seek
- rem tree/formindex
- test seed on all elements
- rework formbutton to the new specs, incl onvalidate
- go public
- fix tree for moz1.8
- improve validation so it can change widgets and cancel harvest()
- remove the caller var from all seed and harvest (extend listbox to do its own harvest)
- implement formbutton seedCGI
- remove statusText and responseText attributes from formbutton
- add checklist and checkgroup formwidgets
- reconsider confusing value/label exchanges (harvest value=value?value:label, seed label=label?value)
- move additional attributes to the formwidget: namespace
FAQ
Is It AJAX ?
If you use it to retrieve serverside XML data I think it is. Please
refrain from abbreviations that have no clear definition somewhere.
But if you want to impress your boss, this is a ECMA driven XUI component,
so it's completely BUZZW compliant :)
What's with values vs. label ?
Formwidgets exchange values and labels quite often .. I agree
it's confusing and needs to be reconsidered. However, often "data input" has no
label to offer to a widget and reversely, normal xulelements have no "value" to offer
for data sets. At times they are swapped at the level of the formwidget, which is
wrong, it could be swapped more generally at the level of the datahandler, eg,
the formbutton.