Forum OpenACS Development: Re: ad_form Questions

Collapse
6: Re: ad_form Questions (response to 1)
Posted by Don Baccus on
Tom's right ... I just picked the ad_page_contract notation for stuff ad_form needs to know about each variable definition for the element create command.

The stuff you pass along as part of the second element in the declaration are the values for the "-options" flag to the template system's element create command.

This makes sense if you know how the template system works.  ad_form's a *wrapper* only and you really need to study the template system to understand it.  That's unfortunate but without an entire rewrite of a bunch of template code and template client code this is about as good as it will get.

Roberto, to add the custom fields use ad_form -extend.  First define the static part of the form, then ad_form -extend to add the attribute-generated elements, then when you're done with all that call ad_form with your edit_request etc blocks.

I'll take a look at the on_request issue soon.  However, you must create form elements for both the request and submit state anyway (ad_form does this automatically) so validation (an integer is really an integer etc) can be done, the values set in the proper scope, etc.