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 , itself not a formwidget,
uses harvest
to create HTTP/CGI queries and execute them.
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
version 1.5.2
20051206 creating prod distro .. not public yet
version 1.5.1
20051206 copying to mozdev .. not public yet
version 1.5.0
20051123 Rewriting the original XULForms code to harvest/seek .. not public yet
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
- 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
- add checklist and checkgroup formwidgets
- reconsider confusing value/label exchanges (harvest value=value?value:label, seed label=label?value)
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 :)
Why use a "name" ?
Why use a "name" attribute when everything in XUL is refered to
with IDs ? Well, there's a conceptual difference. Formwidgets
translate their 'state' to data, so that it can be transferred. The whole
point of transferring data is to have it returned somewhere else. Somewhere
where an ID is perhaps meaningless or worse, different from the original ID. The
name/value pair is meant for data, the ID/label pair is meant for
XUL's DOM and GUI. This doesn't mean I don't ship ID and label
with the data, it just means I need a name attribute, separate from the ID.
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.