Forum OpenACS Q&A: Response to Validating form elements with the form builder

Collapse
Posted by Tom Jackson on

Is it just me or is anyone else concerned with the chunking over the side of ad_page_contract in favor of the form builder procs? My opinion is the .tcl page should be setting up vars for use in an .adp template. If you want to use a different template than the default, just specify the location in the call to ad_return_template. Some parts of the form builder procs are very poorly written. Specifically, template::form get_values calls ns_getform for each value it is asked to get. This requires parsing the entire query set for each value. For a novice like me it takes forever to figure out where the form template is located and to figure out the spagetti code created by this bunch of procs. Sorry for venting, but this approach to coding has so far failed to save me any time on debugging other people's code, an unfortunately necessary past time. Then you get suggestions like Jeff just made to call ns_queryget half way down a page. This is nice and convenient for the developer, but inconvenient for future maintainers. Wasn't there a standard way of doing stuff like this at some point? Why is ad_page_contract even being used in these cases?

The kinds of questions that have arisen lately over the use of this set of procs indicates to me that they are far from convenient to use in anything but the most simple situation.