Commands for managing dynamic templated forms.
template::form::create
template::form::exists
template::form::export
template::form::get_combined_values
template::form::get_values
template::form::is_request
template::form::is_submission
template::form::is_valid
template::form::section
template::form::set_values
* indicates required
Public Methods:template::form::create | ||||||||
Initialize the data structures for a form.
|
template::form::exists | ||
Determine whether a form exists by checking for its data structures.
|
template::form::export |
Generates hidden input tags for all values in a form submission. Typically used to create a confirmation page following an initial submission.
|
template::form::get_combined_values | ||||||
Return a list which represents the result of getting combined values from multiple form elements
|
template::form::get_values | ||||
Set local variables for form variables (assume they are all single values). Typically used when processing the form submission to prepare for DML or other type of transaction.
|
template::form::is_request | ||
Return true if preparing a form for an initial request (as opposed to repreparing a form that is returned to the user due to validation problems). This command is used to conditionally set default values for form elements.
|
template::form::is_submission | ||
Return true if a submission in progress. The submission may or may not be valid.
|
template::form::is_valid | ||
Return true if submission in progress and submission was valid. Typically used to conditionally execute DML and redirect to the next page, as opposed to returning the form back to the user to report validation errors.
|
template::form::section | ||||
Set the name of the current section of the form. A form may be divided into any number of sections for layout purposes. Elements are tagged with the current section name as they are added to the form. A form style template may insert a divider in the form whenever the section name changes.
|
template::form::set_values | ||||
Convenience procedure to set individual values of a form (useful for simple update forms). Typical usage is to query a onerow data source from database and pass the resulting array reference to set_values for setting default values in an update form.
|
Private Methods:
template::form::check_elements | ||
Iterates over all declared elements, checking for hidden widgets and rendering those that have not been rendered yet. Called after rendering a custom form template as a debugging aid.
|
template::form::generate | ||||
Render the finished HTML output for a dynamic form.
|
template::form::get_reference |
Helper procedure used to access the basic data structures of a form object. Called by several of the form commands. |
template::form::render | ||||
Render the HTML FORM tag along with a hidden element that identifies the form object.
|
template::form::template | ||||
Auto-generate the template for a form
|
* indicates required