Forum OpenACS Q&A: Re: E-commerce 'category-browse-subcategory.tcl'

Collapse
Posted by Richard Hamilton on
Torben,

Re:3b

As I understand it, forms created using the forms API by default have their variables passed as form vars rather than url encoded so url surgery is not an issue. The validation and verification services usually provided by ad_page_contract are also taken care of by the forms API.

It should basically take the sweat out of it and reduce the risks, but you're right to want to test everything thoroughly.

Sorry for getting things muddled. I understood that template::form was the recommended way to access the API (either with or without the 'template::' prefix). I had mis-understood the ad_form/ template::form relationship.

I think that template::form code can be laid out to be really easy to read and understand and may therefore have the edge for maintainability. I certainly found it easier to get my head around initially. I'll have a play with the ad_form method though if I understand Dave correctly it can in certain situations be more limiting.

Thanks for the steer Dave.

R.

Collapse
Posted by Torben Brosten on
Yeah, Richard, I was so focused on the element handling I didn't notice you used template::form instead of ad_form in the demo. This is one explanation of why your code was a breeze to understand! I find other's template::form code much easier to read/debug than ad_form.
Collapse
Posted by Richard Hamilton on
Which is of course a perfectly good reason to elect to code that way, as Phil G put it 'to make it easy for your maintenance programmer'.

I am searching for my electronic copy of Roberto Mello's ad_form cheatsheet which I think you'll find very helpful too.

I'll sent it as soon as I find it.

R.

Collapse
Posted by Torben Brosten on
Thank you, Richard,

I have Mello's ad_form quicksheet (and most all other ad_form references that are publicly available).

The quicksheet is available here: https://openacs.org/storage/view/ad-form-quick-ref.pdf

cheers,

Torben