Index: openacs-4/packages/acs-templating/tcl/list-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/list-procs.tcl,v
diff -u -r1.13 -r1.14
--- openacs-4/packages/acs-templating/tcl/list-procs.tcl 11 Dec 2003 21:39:57 -0000 1.13
+++ openacs-4/packages/acs-templating/tcl/list-procs.tcl 14 Dec 2003 14:54:24 -0000 1.14
@@ -22,7 +22,7 @@
ad_proc -public template::list::create {
{-name:required}
- {-multirow:required}
+ {-multirow ""}
{-key ""}
{-pass_properties ""}
{-actions ""}
@@ -114,7 +114,7 @@
@param name The name of the list you want to build.
- @param multirow The name of the multirow which you want to loop over.
+ @param multirow The name of the multirow which you want to loop over. Defaults to name of the list.
@param key The name of the column holding the primary key/unique identifier for each row.
Must be a single column, which must be present in the multirow.
@@ -305,16 +305,24 @@
set list_properties(class) $list_properties(main_class)
}
+ # Default 'multirow' to list name
+ if { [empty_string_p $list_properties(multirow)] } {
+ set list_properties(multirow) $name
+ }
+
# Set up automatic 'checkbox' element as the first element
- if { !$has_checkboxes_p && [llength $bulk_actions] > 0 && ![empty_string_p $key] } {
+ if { !$has_checkboxes_p && [llength $bulk_actions] > 0 } {
+ if { [empty_string_p $key] } {
+ error "You cannot have bulk_actions without providing a key"
+ }
# Create the checkbox element
# We only ulevel 1 here, because we want the subst to be done in this namespace
template::list::element::create \
-list_name $name \
-element_name $checkbox_name \
-spec {
label {}
- display_template {}
+ display_template {}
sub_class {narrow}
html { align center }
}