Title: Message
There are actually three pieces:
 
- Formedit.taf, which allows you to edit form definitions via a browser.
- Admin.taf which contains some login logic, the menu-builder and the hook into the FormBuild object.
- FormBuild.tcf that contains the code to build the forms and handle all database interaction.
 
FormBuild.tcf depends solely on the database form definition to control its behaviour. It doesn't generate a TCF, it just interprets the form definition and builds HTML
 
FormBuild uses two databases to define a form:
 
FormDef contains information about the behaviour of the form:
  • Title
  • Label BGcolor
  • Data cell BGcolor
  • Seach function toggle
  • Allow Save
  • Allow Delete
  • Allow Insert
  • Which fields are used in the search (ID field, displayed value for drop-down)
FormDefItem contained the definition of each field:
  • Associated database field
  • Element type (text, textarea, radio, checkbox, select, file upload, hidden)
  • Columns (length of field)
  • MaxLength
  • Rows (used for Textarea)
  • Special type (provides date-pop-up or color dialog pop-up)
  • Validation flag (whether it checks for a valid selection or blank value for this field)
  • Field Label
  • Sort order
  • Additonal fields for defining SELECT statement lookup values using SQL statement
Part of Admin.taf is the menu generator. It uses a database to define a menu structure:
  • Label
  • Active/Inactive toggle
  • Querystring to pass to whne clicked
  • Parent node toggle
  • Child-parent reference
  • Class name for this item (if you want to use a stylesheet)
  • External/Internal call flag (by default it calls itself)
  • Sort order
  • UserLevel requited to see item (can be inegrated into your own security structure)
  • Tree Number (You can have multiple menu trees in the same database)
Using FormBuild is easy:
  • Add the FormDef tables to your application database
  • Set the datasource for Admin.Taf, Formedit.taf and Formbuild.tcf
  • Run FormEdit and start defining your forms
  • Use the menu editor to add the calls to those forms to your menu tree
The key here: No CODE! You can build a complete back-end interface in less than 5 minutes per table.
 
If you want to do more advanced stuff you can wrap some logic around admin.taf where it calls FormBuild.
 
I was working too hard building all these damn forms all the time. Laziness rules!
 
- James
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of [Gauthier]
Sent: Monday, April 29, 2002 9:51 PM
To: Multiple recipients of list witango-talk
Subject: Re: Witango-Talk: Added and changing SQL tables & building forms

formbuild seems to be a well advanced tool,
i will be interested to discover how did you store the form templates after you have generated it with the formbuilder?
did you store these infos in sort of ini file that is used in conjunction with the main .taf that will interpret it or does it litteraly generate a .taf for each form/table?
 
thnaks for a further description
 
Gauthier
 
----- Original Message -----
Sent: Tuesday, April 30, 2002 1:19 AM
Subject: Witango-Talk: Added and changing SQL tables & building forms

Hi Dan,

Yup, I've written one. It dynamically generates ALTER TABLE and CREATE TABLE SQL statements. The issues come when someone takes an existing table and tries to change the data-type of a field, SQL can't handle every situation by itself, which leads to bothersome error-handling.

Because of this I've limited the data types to: varchar, bit, int, date money and floating point, which handles 95% of what you'll use on a web site anyway. You can build new tables, add and remove fields as well as change data types. It's got a few SQL syntax bugs that would probably only take me an hour or two to sort out. Right now I don't have the time to do it. If you want to take the time to tweak it let me know and I'll send you the TAF, otherwise wait a few weeks and I'll post it.

It's part of a bigger application I made called Formbuild, which is basically a back-end in a can. You can define forms, map them to database tables and select which fields appear on the form, in what order and what form element type they are shown as (text, textarea, radio, select etc), along with complete javascript validation options for each field. It also builds a drop-down or text-search record selection form. It even handles building a left-frame menu. You can build an entire back end without touching any code in about 15 minutes.

I basically got sick of coding database look-ups that populate forms and save data back again, so I built a class file that handles everything based on a form definition in a database. The docs are online if you're interested:

http://209.47.192.71/staffpages/jameslab/formbuilddocs/index.htm

- James

Reply via email to