ad_generic_optionlist (public)

 ad_generic_optionlist items values [ default ]

Defined in packages/acs-tcl/tcl/widgets-procs.tcl

Use this to build select form fragments. Given a list of items and a list of values, will return the option tags with default highlighted as appropriate.

Parameters:
items (required)
values (required)
default (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_ad_generic_optionlist ad_generic_optionlist (test acs-tcl) ad_generic_optionlist ad_generic_optionlist test_ad_generic_optionlist->ad_generic_optionlist ad_color_widget ad_color_widget (public, deprecated) ad_color_widget->ad_generic_optionlist packages/acs-admin/www/apm/parameter-add.tcl packages/acs-admin/ www/apm/parameter-add.tcl packages/acs-admin/www/apm/parameter-add.tcl->ad_generic_optionlist packages/acs-admin/www/apm/parameter-edit.tcl packages/acs-admin/ www/apm/parameter-edit.tcl packages/acs-admin/www/apm/parameter-edit.tcl->ad_generic_optionlist

Testcases:
ad_generic_optionlist
Source code:

    # items is a list of the items you would like the user to select from
    # values is a list of corresponding option values
    # default is the value of the item to be selected
    set count 0
    set return_string ""
    foreach value $values {
        if {  $default eq $value  } {
            append return_string "<option selected=\"selected\" value=\"$value\">[lindex $items $count]</option>\n"
        } else {
            append return_string "<option value=\"$value\">[lindex $items $count]</option>\n"
        }
        incr count
    }
    return $return_string
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/widgets-procs.xql

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