Forum OpenACS Development: Re: Rendering an ad_form without formtemplate tag

Collapse
Posted by Gustaf Neumann on
This costed me some hairs as well. xowiki renders ad_forms using adp_include and returns the result as HTML. One can reference via the included adp-chunk different form templates. Checkout in xowiki/tcl/xowiki-www-procs the method Page->edit (build a form via ad_form). Page->edit calls finally Package->return_page (in xotcl-core/tcl/06-package-procs).

Maybe this helps
-gustaf neumann

Collapse
Posted by Frank Bergmann on
Thanks a lot for the answers!!

Frank

Collapse
Posted by Frank Bergmann on
Hi,

The code still needs to run on OpenACS 5.1, so adp_include doesn't exist there. But looking through the source I found this very simple solution:

eval [template::adp_compile -string {[formtemplate id="project_filter"][/formtemplate]}]
set filter_html $__adp_output

(replaced angle brackets by brackets because of restrictions here in the forum...)

This version doesn't cache the compiled code, but that performance penalty should be OK because it's quite a short piece of code.

Cheers!
Frank