- Publicity: Public Only All
widget-procs.tcl
Form widgets for the ArsDigita Templating System
- Location:
- packages/acs-templating/tcl/widget-procs.tcl
- Authors:
- Karl Goldstein <karlg@arsdigita.com>
- Stanislav Freidin <sfreidin@arsdigita.com>
- CVS Identification:
$Id: widget-procs.tcl,v 1.66 2024/09/11 06:15:48 gustafn Exp $
Procedures in this file
- template::data::transform::checkbox_text (public)
- template::data::transform::party_search (private)
- template::data::transform::radio_text (public)
- template::data::transform::search (public)
- template::data::transform::select_text (public)
- template::data::validate::checkbox_text (public)
- template::data::validate::party_search (public)
- template::data::validate::radio_text (public)
- template::data::validate::select_text (public)
- template::util::checkbox_text::get_property (public)
- template::util::radio_text::get_property (public)
- template::util::select_text::get_property (public)
- template::widget (public)
- template::widget::attachment (public)
- template::widget::block (public)
- template::widget::button (public)
- template::widget::checkbox (public)
- template::widget::checkbox_text (public)
- template::widget::color (public)
- template::widget::comment (public)
- template::widget::email (public)
- template::widget::file (public)
- template::widget::hidden (public)
- template::widget::inform (public)
- template::widget::input (public)
- template::widget::menu (public)
- template::widget::merge_tag_attributes (public)
- template::widget::multiselect (public)
- template::widget::number (public)
- template::widget::party_search (public)
- template::widget::password (public)
- template::widget::radio (public)
- template::widget::radio_text (public)
- template::widget::search (public)
- template::widget::select (public)
- template::widget::select_text (public)
- template::widget::submit (public)
- template::widget::tel (public)
- template::widget::text (public)
- template::widget::textarea (public)
- template::widget::textarea_internal (private)
- template::widget::url (public)
Detailed information
template::data::transform::checkbox_text (public)
template::data::transform::checkbox_text element_ref
- Parameters:
- element_ref (required)
- Returns:
- Error:
- Author:
- Timo Hentschel <timo@timohentschel.de>
- Created:
- 2004-10-17
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::data::transform::party_search (private)
template::data::transform::party_search element_ref
Do the actual search of parties using the input value and return a list of lists consisting of (party_name, party_id). DRB: The blank string check should actually be in the validate procedure.
- Parameters:
- element_ref (required)
- Reference variable to the form element.
- Returns:
- search result or error
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::data::transform::radio_text (public)
template::data::transform::radio_text element_ref
- Parameters:
- element_ref (required)
- Returns:
- Error:
- Author:
- Timo Hentschel <timo@timohentschel.de>
- Created:
- 2004-10-17
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::data::transform::search (public)
template::data::transform::search element_ref
Process a submitted search widget's data.
- Parameters:
- element_ref (required)
- Reference variable to the form element
- Returns:
- Transformed value
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::data::transform::select_text (public)
template::data::transform::select_text element_ref
- Parameters:
- element_ref (required)
- Returns:
- Error:
- Author:
- Dave Bauer <dave@thedesignexperience.org>
- Created:
- 2004-07-18
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::data::validate::checkbox_text (public)
template::data::validate::checkbox_text value_ref message_ref
validate a checkbox_other datatype
- Parameters:
- value_ref (required)
- message_ref (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- validate_text
template::data::validate::party_search (public)
template::data::validate::party_search value_ref message_ref
Validate the party search entry form.
- Parameters:
- value_ref (required)
- A reference to the value input by the user.
- message_ref (required)
- A reference to the form element error field.
- Returns:
- true - all input for this datatype is valid.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- validate_search
template::data::validate::radio_text (public)
template::data::validate::radio_text value_ref message_ref
validate a radio_other datatype
- Parameters:
- value_ref (required)
- message_ref (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- validate_text
template::data::validate::select_text (public)
template::data::validate::select_text value_ref message_ref
validate a select_text datatype
- Parameters:
- value_ref (required)
- message_ref (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- validate_text
template::util::checkbox_text::get_property (public)
template::util::checkbox_text::get_property what checkbox_list
- Parameters:
- what (required)
- checkbox_list (required)
- Returns:
- Error:
- Author:
- Timo Hentschel <timo@timohentschel.de>
- Created:
- 2004-10-17
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::util::radio_text::get_property (public)
template::util::radio_text::get_property what radio_list
- Parameters:
- what (required)
- radio_list (required)
- Returns:
- Error:
- Author:
- Timo Hentschel <timo@timohentschel.de>
- Created:
- 2004-10-17
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::util::select_text::get_property (public)
template::util::select_text::get_property what select_text_list
- Parameters:
- what (required)
- select_text_list (required)
- Returns:
- Error:
- Author:
- Dave Bauer <dave@thedesignexperience.org>
- Created:
- 2004-07-18
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget (public)
template::widget
The template::widget namespace contains the code for the various input widgets.
- See Also:
- template::widget::ampmFragment
- template::widget::block
- template::widget::button
- template::widget::checkbox
- template::widget::checkbox_text
- template::widget::color
- template::widget::comment
- template::widget::currency
- template::widget::date
- template::widget::dateFragment
- template::widget::email
- template::widget::file
- template::widget::hidden
- template::widget::inform
- template::widget::input
- template::widget::menu
- template::widget::monthFragment
- template::widget::multiselect
- template::widget::number
- template::widget::numericRange
- template::widget::password
- template::widget::party_search
- template::widget::radio
- template::widget::radio_text
- template::widget::search
- template::widget::select
- template::widget::select_text
- template::widget::submit
- template::widget::tel
- template::widget::text
- template::widget::textarea
- template::widget::url
- template::element::create
- template::util::richtext
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::attachment (public)
template::widget::attachment element_reference tag_attributes
Render an attachment input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::block (public)
template::widget::block element_reference tag_attributes
Widget for blocks of radio-buttoned questions
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::button (public)
template::widget::button element_reference tag_attributes
Render a button input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::checkbox (public)
template::widget::checkbox element_reference tag_attributes
Render a checkbox input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::checkbox_text (public)
template::widget::checkbox_text element_reference tag_attributes
Implements the complex widget checkbox_other which combines a checkbox widget with a text widget
- Parameters:
- element_reference (required)
- tag_attributes (required)
- Returns:
- Error:
- Author:
- Timo Hentschel <timo@timohentschel.de>
- Created:
- 2004-10-17
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::color (public)
template::widget::color element_reference tag_attributes
Render a color input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::comment (public)
template::widget::comment element_reference tag_attributes
Render a comment widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::email (public)
template::widget::email element_reference tag_attributes
Render a email input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::file (public)
template::widget::file element_reference tag_attributes
Generate a file widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- template_widget_file
template::widget::hidden (public)
template::widget::hidden element_reference tag_attributes
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::inform (public)
template::widget::inform element_reference tag_attributes
A static information widget that does not submit any data
- Parameters:
- element_reference (required)
- tag_attributes (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::input (public)
template::widget::input type element_reference tag_attributes
General proc used by a wide variety of widgets to output input HTML tags.
- Parameters:
- type (required)
- The type of widget (checkbox, radio, text etc)
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to hang on the input tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::menu (public)
template::widget::menu widget_name options_list values_list \ attribute_reference [ mode ] [ widget_type ]
Render a menu widget (a "select" dropdown menu by default).
- Parameters:
- widget_name (required)
- Name of the widget
- options_list (required)
- List of option/value pairs (i.e. dropdown menu items)
- values_list (required)
- List of values (i.e. the selected default value)
- attribute_reference (required)
- Reference variable to the caller's tag_attributes param
- mode (optional, defaults to
"edit"
)- If "edit" the widget is rendered, otherwise values are passed along using hidden input HTML tags
- widget_type (optional, defaults to
"select"
)- Select, checkbox, etc
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::merge_tag_attributes (public)
template::widget::merge_tag_attributes element_reference \ tag_attributes
Consolidates the logics to compute the final tag attributes by merging those explicitly supplied and those in the element definition.
- Parameters:
- element_reference (required)
- tag_attributes (required)
- Returns:
- dict
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::multiselect (public)
template::widget::multiselect element_reference tag_attributes
Render a select widget which allows any number of values to be selected.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::number (public)
template::widget::number element_reference tag_attributes
Render a number input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::party_search (public)
template::widget::party_search element_reference tag_attributes
A widget that searches for parties (persons, groups and relational_segments) and lets the user select one from the search results.
It only searches in all parties from the system currently. It should probably be extended to allow one to restrict the search to a specific subsite, as well as searching only for groups or persons.
- Parameters:
- element_reference (required)
- tag_attributes (required)
- Author:
- Tilmann Singer
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::password (public)
template::widget::password element_reference tag_attributes
Generate a password input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::radio (public)
template::widget::radio element_reference tag_attributes
Render a radio input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::radio_text (public)
template::widget::radio_text element_reference tag_attributes
Implements the complex widget radio_text which combines a radio widget with a text widget
- Parameters:
- element_reference (required)
- tag_attributes (required)
- Returns:
- Error:
- Author:
- Timo Hentschel <timo@timohentschel.de>
- Created:
- 2004-10-17
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::search (public)
template::widget::search element_reference tag_attributes
Return a widget consisting of either a search box or a search pull-down list. Here is an example of using the search widget with ad_form:
ad_form -name test -form { {user:search,optional {result_datatype integer} {label "Email"} {help_text "Search for a user by email address"} {search_query { select email from cc_users where lower(email) like '%'||lower(:value)||'%' }} } }Can be either a select widget initially if options supplied or a search box which on submit changes to a select widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- If the "options" attribute is passed in, a select widget is created, otherwise a search box.
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::select (public)
template::widget::select element_reference tag_attributes
Render a select widget which allows only one value to be selected.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::select_text (public)
template::widget::select_text element_reference tag_attributes
Implements the complex widget select_text which combines a select widget with a text widget
- Parameters:
- element_reference (required)
- tag_attributes (required)
- Returns:
- Error:
- Author:
- Dave Bauer <dave@thedesignexperience.org>
- Created:
- 2004-07-18
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::submit (public)
template::widget::submit element_reference tag_attributes
Render a submit input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::tel (public)
template::widget::tel element_reference tag_attributes
Render a tel input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::text (public)
template::widget::text element_reference tag_attributes
Generate a text widget (not to be confused with textarea)
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::textarea (public)
template::widget::textarea element_reference tag_attributes
A widget for the HTML form input textarea element. Includes spellchecker.
- Parameters:
- element_reference (required)
- Reference to the form element.
- tag_attributes (required)
- Html attributes to set in the widget.
- Returns:
- Form HTML for widget
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::textarea_internal (private)
template::widget::textarea_internal name attribute_reference [ value ] \ [ mode ] [ tag ]
Do the actual construction of a textarea widget, called by various user-callable widgets.
- Parameters:
- name (required)
- Name of the widget.
- attribute_reference (required)
- Reference variable to the tag_attributes passed to the calling widget proc.
- value (optional)
- Optional value
- mode (optional, defaults to
"edit"
)- If edit, output the textarea HTML, otherwise pass along the value (if it exists) in a hidden HTML input tag
- tag (optional, defaults to
"textarea"
)- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
template::widget::url (public)
template::widget::url element_reference tag_attributes
Render a URL input widget.
- Parameters:
- element_reference (required)
- Reference variable to the form element
- tag_attributes (required)
- HTML attributes to add to the tag
- Returns:
- Form HTML for widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.