Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -N -r1.95 -r1.96 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 17 Sep 2008 14:51:22 -0000 1.95 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 17 Sep 2008 19:04:40 -0000 1.96 @@ -1001,7 +1001,39 @@ } } + ########################################################### + # + # ::xowiki::formfield::checkbox + # + ########################################################### + Class checkbox -superclass enumeration -parameter { + {horizontal false} + } + checkbox instproc initialize {} { + my set multiple true + my set widget_type text(checkbox) + next + } + checkbox instproc value_if_nothing_is_returned_from_from {default} { + return "" + } + checkbox instproc render_input {} { + # identical to radio, except "checkbox" type and lsearch; + # maybe we can push this up to enumeration.... + set value [my value] + foreach o [my options] { + foreach {label rep} $o break + set atts [my get_attributes disabled {CSSclass class}] + lappend atts id [my id]:$rep name [my name] type checkbox value $rep + if {[lsearch -exact $value $rep] > -1} {lappend atts checked checked} + ::html::input $atts {} + html::t "$label " + if {![my horizontal]} {html::br} + } + } + + ########################################################### # # ::xowiki::formfield::select