template::form::template (private)

 template::form::template id [ style ]

Defined in packages/acs-templating/tcl/form-procs.tcl

Auto-generate the template for a form

Parameters:
id (required)
The form identifier
style (optional)
The style template to use when generating the form. Form style templates must be placed in the forms subdirectory of the ATS resources directory.
Returns:
A string containing a template for the body of the form.

Partial Call Graph (max 5 caller/called nodes):
%3 template::form::generate template::form::generate (private) template::form::template template::form::template template::form::generate->template::form::template template::frm_page_handler template::frm_page_handler (public) template::frm_page_handler->template::form::template ad_conn ad_conn (public) template::form::template->ad_conn apm_package_id_from_key apm_package_id_from_key (public) template::form::template->apm_package_id_from_key parameter::get parameter::get (public) template::form::template->parameter::get template::adp_init template::adp_init (public) template::form::template->template::adp_init template::form::get_reference template::form::get_reference (private) template::form::template->template::form::get_reference

Testcases:
No testcase defined.
Source code:

    get_reference

    #
    # Elements
    # RAL: moved this below so we could take advantage of the template::element
    # API in the button loop above.  The buttons multirow in standard.adp is
    # no longer necessary.
    #
    set elements:rowcount 0

    foreach element_ref $elements {

        incr elements:rowcount

        # get a reference by index for the multirow data source
        upvar #$level $element_ref elements:${elements:rowcount}
        set "elements:${elements:rowcount}(rownum)" ${elements:rowcount}
    }

    if {$style eq {}} {
        set style [parameter::get  -package_id [ad_conn subsite_id]  -parameter DefaultFormStyle  -default [parameter::get  -package_id [apm_package_id_from_key "acs-templating"]  -parameter DefaultFormStyle  -default "standard-lars"]]
    }

    set file_stub [template::resource_path -type forms -style $style]

    if { ![file exists "$file_stub.adp"] } {
        # We always have a template named 'standard'
        set file_stub [template::resource_path -type forms -style standard]
    }

    #
    # Ensure that the style template has been compiled and is
    # up-to-date, and execute the result into __adp_output.  The only
    # data source on which this template depends is the "elements"
    # multirow data source.  The output of this procedure will be
    # placed in __adp_output in this stack frame.
    #
    [template::adp_init adp $file_stub]

    return $__adp_output
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: