template::widget::dateFragment (public)

 template::widget::dateFragment element_reference fragment size type \
    value [ mode ] [ tag_attributes ]

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

Create an input widget for the given date fragment If type is "t", uses a text widget for the fragment, with the given size. Otherwise, determines the proper widget based on the element flags, which may be text or a picklist.

Parameters:
element_reference (required)
fragment (required)
size (required)
type (required)
value (required)
mode (optional, defaults to "edit")
tag_attributes (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 ad_pad ad_pad (public) template::util::date::defaultInterval template::util::date::defaultInterval (public) template::util::date::get_property template::util::date::get_property (public) template::widget::input template::widget::input (public) template::widget::numericRange template::widget::numericRange (public) template::widget::dateFragment template::widget::dateFragment template::widget::dateFragment->ad_pad template::widget::dateFragment->template::util::date::defaultInterval template::widget::dateFragment->template::util::date::get_property template::widget::dateFragment->template::widget::input template::widget::dateFragment->template::widget::numericRange

Testcases:
No testcase defined.
Source code:
    upvar $element_reference element

    set value [template::util::date::get_property $fragment $value]
    set value [util::trim_leading_zeros $value]

    if {$value eq ""} {
        set att_value ""
    } else {
        set att_value [ad_pad -left $value $size 0]
    }

    if { $mode ne "edit" } {
        return [subst {<input type="hidden" name="$element(name).$fragment" value="${att_value}">$value}]
    } else {
        if { [info exists element(${fragment}_interval)] } {
            set interval $element(${fragment}_interval)
        } else {
            # Display text entry for some elements, or if the type is text
            if { $type == "t"
                 || [regexp "year|short_year" $fragment]
             } {
                set output "<input type=\"text\" name=\"$element(name).$fragment\" id=\"$element(name).$fragment\" size=\"$size\""
                append output " maxlength=\"$size\" value=\"${att_value}\""
                array set attributes $tag_attributes
                foreach attribute_name [array names attributes] {
                    if {$attributes($attribute_name) eq ""} {
                        append output $attribute_name"
                    } else {
                        append output $attribute_name=\"$attributes($attribute_name)\""
                    }
                }
                append output ">\n"
                return $output
            } else {
                # Use a default range for others
                set interval [template::util::date::defaultInterval $fragment]
            }
        }
        return [template::widget::numericRange "$element(name).$fragment"  $interval $size $value $tag_attributes]
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: