Index: openacs-4/packages/spreadsheet/tcl/form-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/spreadsheet/tcl/form-procs.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/spreadsheet/tcl/form-procs.tcl 8 Jan 2011 01:50:03 -0000 1.7
+++ openacs-4/packages/spreadsheet/tcl/form-procs.tcl 10 Jan 2011 09:36:03 -0000 1.8
@@ -351,13 +351,15 @@
{arg21 ""}
{arg22 ""}
} {
- creates a form select/options tag, supplying attributes where nonempty values are supplied. set multiple to 1 to activate.
+ creates a form select/options tag, supplying attributes where nonempty values are supplied. set multiple to 1 to activate multiple attribute.
+ "value" argument is a list_of_lists passed to qf_options, where the list_of_lists represents a list of OPTION tag attribute/value pairs.
+ Alternate to passing "value", you can pass pure html containing literal Option tags as "value_html"
} {
# use upvar to set form content, set/change defaults
# __qf_arr contains last attribute values of tag, indexed by {tag}_attribute, __form_last_id is in __qf_arr(form_id)
upvar __form_ids_list __form_ids_list, __form_arr __form_arr
upvar __qf_remember_attributes __qf_remember_attributes, __qf_arr __qf_arr
- upvar __form_ids_fieldset_open_list __form_ids_fieldset_open_list
+ upvar __form_ids_select_open_list __form_ids_select_open_list
set attributes_full_list [list value accesskey align class cols id name readonly rows style tabindex title wrap]
set arg_list [list $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7 $arg8 $arg9 $arg10 $arg11 $arg12 $arg13 $arg14 $arg15 $arg16 $arg17 $arg18 $arg19 $arg20 $arg21 $arg22]
@@ -404,28 +406,119 @@
}
}
-# call qf_options
- set tag_html ""
+ set tag_html ""
+ set previous_select 0
+ # first close any existing selects tag with form id
+ set __select_open_list_exists [info exists __form_ids_select_open_list]
+ if { $__select_open_list_exists } {
+ if { [lsearch $__form_ids_select_open_list $attributes_arr(id)] > -1 } {
+ append tag_html "\n"
+ set previous_select 1
+ }
+ }
+ # set results __form_ids_select_open_list
+ if { $previous_select } {
+ # no changes needed, "select open" already indicated
+ } else {
+ if { $__select_open_list_exists } {
+ lappend __form_ids_select_open_list $attributes_arr(id)
+ } else {
+ set __form_ids_select_open_list [list $attributes_arr(id)]
+ }
+ }
+
+ # add options tag
+ if { [info exists attributes_arr(value_html)] } {
+ set value_list_html $attributes_arr(value_html)
+ } else {
+ set value_list_html ""
+ }
+ if { [info exists attributes_arr(value)] } {
+ append value_list_html [qf_options $attributes_arr(value)]
+ }
+
+ append tag_html "