template::widget::select_text (public)

 template::widget::select_text element_reference tag_attributes

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

Implements the complex widget select_text which combines a select widget with a text widget

Parameters:
element_reference
tag_attributes
Returns:
Error:
Author:
Dave Bauer <dave@thedesignexperience.org>
Created:
2004-07-18

Partial Call Graph (max 5 caller/called nodes):
%3 _ _ (public) template::widget::select_text template::widget::select_text template::widget::select_text->_

Testcases:
No testcase defined.
Source code:

    upvar $element_reference element
    if { [info exists element(html)] } {
        array set attributes $element(html)
    }

    array set attributes $tag_attributes

    if { [info exists element(value)] } {
        set select [template::util::select_text::get_property select_value $element(value)]
        set text   [template::util::select_text::get_property text_value $element(value)]
    } else {
        set select {}
        set text {}
    }

    set output {}
    if {$element(mode) eq "edit"} {
        # edit mode
        set element(value) $select
        append output [template::widget::menu $element(name) $element(options) $select attributes $element(mode)]

        if {![info exists element(other_label)]} {
            set element(other_label) "[_ acs-templating.Other]"
        }
        append output $element(other_label): "
        set element(value) $text
        set element(name) $element(name)\.text
        append output [template::widget::input text element $tag_attributes]
    } else {
        # display mode
        if { [info exists element(value)] } {
            append output  [template::util::select_text::get_property select_value $element(value)]  "&nbsp;"  [template::util::select_text::get_property text_value $element(value)]  [subst {<input type="hidden" name="$element(id).text" value="[ns_quotehtml $text]">}]  [subst {<input type="hidden" name="$element(id)" value="[ns_quotehtml $select]">}]
        }
    }

    return $output
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-templating/tcl/widget-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: