Forum OpenACS Development: Re: ad_form for new and edit requests

Collapse
Posted by Ola Hansson on
Well, while there is no free lunch, display mode in the form builder does give you a lot for free, I guess. For example - not having to write a separate, non-form, object display page in addition to the add/edit page - and consistency in layout among package implementors for another. After all, the data the form handles is _usually_ the same data you want to present, so why not take advantage of this? I kind of like those qualities which follows from Lars' augmenting of the FB. This is not to say I'm not going to like the CR approach taken in CMS, if that ends up the norm. I just haven't seen that stuff in action, I might love it if I do.

The principles in the example script that I pointed to in my first response to Joel has actually been copied, more or less verbatim, from code I found in bug-tracker so please don't let me take any of the glory (and none of the shame)!

There is one distingtive way in which my style of writing form scripts - in the curriculum package, at least - differs from the style used in Bug Tracker, though. BT uses two pages, one for adding a bug and one for displaying/editing it. I figured much would be won (although simplicity would be lost) if I could merge them into one instead, and not have to maintain two basically identical ad_form definitions ... But that's just my oppinion, of course.

Also, by putting the form script under lib/ rather than www/ you'll acheive a better flexibility, I think, in terms of where you can include the form snippet, or, more interestingly, the -display mode piece.

Hell, If someone thinks the element-ave.tcl script that is linked to above is getting hairy you almost definitely do not want to look at curriculum-ave.tcl. There's no two ways about it - the added complexity that comes with a workflow'ed package that's got some fields which are editable while some fields are not, and where all three functions (add, view, edit) are mixed together, really begins to become a problem. 😃

Don't worry Don. Building forms _have_ become _much_ more straight-forward and less error-prone since you created ad_form compared to form builder proper, let alone writing forms and errorhandling, etc, by hand! So, if warranted (and documented) there should still be room for one or two spiffy features, IMHO.

/Ola