Yes, give it a try! As i started working with BC i really thought this was the missing link, because forms are used everywhere. The generall approach seems genious and easy to use. But as soon i ran into trouble because of the maintainability of such forms and missing features. So i made some more improvements on it myself:
Multiple actions
---------------
Just add as many action-lines as you want. If one action fails, the execution-chain stops. Sometimes it would be nice to use the result of an previous action inside the next one. I've hacked this by using a new global @@ACTION_RESULT@@. This may also be used in the "thanks" command.
Commenting lines
-----------------
Simply comment out lines with a hash in front (#) like
# this is a comment
#textbox owner ....
Escape char
------------
Use backslash as an escape char to make doublequotes usable inside params.
select preferred_drink "Hot chocolate|Coffee \"Italian style\"|Green tea|Ice tea"
Multiline actions/fieldcommands
------------------------------
This can be done by adding a backslash (escape-char) as the last char in line. The next line is concated automatically (with all whitespace from left remove), so one could span long commands (e.g. selects or actions) or many lines.
select megasel "Well, this gonna be a long list. Heres number 1.\
|goes on with number two\
|great, i could do this whole day long..."
Use field-IDs instead of label
----------------------------
The use of fields labels to refer to them makes writing forms easy but hard to maintain. I haked this by adding a title-option,
so i simply use the labeltext for fieldnames (IDs) and change the renderer to use the "title" instead. Looks like this:
textbox name title="Your full name"
This is a bad hack but i would have to change the syntax of BC to do it an other way.
Add select option key
----------------------
Select-fields return their option label. I've add a way to use option keys instead:
select country "de=Germany|us=United States of America|
Redirect-Action
---------------
I often need to go to another page after successfully submitting a form (e.g. using page templates). All preceeding key=val pairs are submitted as form params to the destination.
action show namespace1:page
action show namespace2:newpage do=edit
action show http://www.server.de/results.php?n=@@NAME@@&c=@@COUNTRY@@
action show http://www.server.de/results.php n=@@NAME@@ c=@@COUNTRY@@
database-action
----------------
Well, this is more an internal thing. dbalias could be defined in config, so noone had to code credentials into the pagesource.
action database mysql://user:pass@hostname/dbname "INSERT INTO mytable SET name=@@NAME@@,country=@@COUNTRY@@"
action database dbalias "SQL-QUERY"
My whishlist:
* having dynamic fields made from SQL-Queries or AJAX calls.
* prefilling forms by SQL-Queries
* have more control of position and size of fields (e.g. length of textfields or areas)
* custom buttons (have a form with just a button to do actions in wiki or other webservices)
* adding hints to fields
* add custom date formats (localized)
* support for multipage forms (wizards)
* adding more actions
* autofields, which are populated from database-definitions by their name
* virtual fields, build from other fields