Forum OpenACS Development: Re: ad_form all over the place?

Collapse
Posted by Don Baccus on
HuH?  ad_form supports what the form builder supports.  So, let's talk about the form builder, not ad_form.  ad_form does none of the things you suggest.  The semantics are all form builder semantics, nothing more.

You can, if you want, build your custom look-and-feel form using form templating tags rather than use a standard template.  These go into the .adp file and, just like as is true with the rest of the template system, look like augmented HTML.  For input forms that have to meet a particular look and feel that can't be generalized in a template that's shared by many forms in the system, that's the way to go.

It is simply untrue that the form builder - or ad_form - can't handle pages where more than one object is being edited or input.  ad_form's key management stuff (one of the few things it brings to the table that doesn't exist in the form builder per se) can't be used - you have to do that yourself.  But if you don't use ad_form you also have to do it yourself.  The bottom line, though, is that it can be done.

And indeed most of the forms I've built with ad_form do handle more than one object - a content item and its associated content revision.  Two, not one, objects, in the same form.

I've also used it in the homework package where we link two objects together (homework and correction files) with no problem.

As far as getting your head around it ... it helps a *lot* if you understand how the form builder itself works, because after all ad_form is first and foremost a wrapper that simplifies the use of the form builder.

Of course ... no one is forcing you to use the form builder.

I have practical experience with this at Greenpeace, where I was able to shrink several thousands of lines of hand-built HTML that built forms into literally less than a 100 lines of .adp code in a shared form template.  And the Tcl code shrunk by 3/4 to boot.  Now that was extremely poorly written code I was replacing but I doubt you're going to convince the GP people that going back to hand-built forms written in pure HTML is an improvement.

Curiously previous discussion has developed the theme that automatic form building using type metadata to feed the template system's form builder would be adequate for admin forms but in general forms built by hand (but using the form builder/ad_form) would be necessary for more generalized forms.