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 -r1.284.2.69 -r1.284.2.70 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 25 Jan 2020 13:40:39 -0000 1.284.2.69 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 26 Jan 2020 16:48:40 -0000 1.284.2.70 @@ -35,7 +35,7 @@ {mode edit} {disabled} {show_raw_value} - {CSSclass} + {style} {type text} {label} @@ -49,6 +49,13 @@ {validator ""} {validate_via_ajax} + {CSSclass} + {form_item_wrapper_CSSclass} + {form_widget_CSSclass} + {form_button_CSSclass} + {form_button_wrapper_CSSclass} + {form_help_text_CSSclass} + {autocomplete} {autofocus} {formnovalidate} @@ -445,10 +452,14 @@ FormField instproc render_form_widget {} { # This method provides the form-widget wrapper - set CSSclass [:form_widget_CSSclass] - if {[:error_msg] ne ""} {append CSSclass " form-widget-error"} + set CSSclass [expr {[info exists :form_widget_CSSclass] ? ${:form_widget_CSSclass} : ""}] + if {${:error_msg} ne ""} { + append CSSclass " form-widget-error" + } set atts [list class $CSSclass] - if {${:inline}} {lappend atts style "display: inline;"} + if {${:inline}} { + lappend atts style "display: inline;" + } ::html::div $atts { :render_input } } @@ -542,7 +553,7 @@ } FormField instproc render_item {} { - ::html::div -class [:form_item_wrapper_CSSclass] { + ::html::div [:get_attributes {form_item_wrapper_CSSclass class}] { if {[:error_msg] ne ""} { set CSSclass form-label-error } else { @@ -1238,11 +1249,15 @@ } CompoundField instproc create_components {spec_list} { + #:log "create_components $spec_list" + # # Omit after specs for compound fields to avoid multiple # recreations. # - if {[:specs_unmodified $spec_list]} return + if {[:specs_unmodified $spec_list]} { + return + } # # Build a component structure based on a list of specs @@ -1251,6 +1266,7 @@ set :structure $spec_list set :components [list] foreach entry $spec_list { + #:log "create_components creates $entry" lassign $entry name spec # # create for each component a form field @@ -4900,7 +4916,10 @@ Class create form_constraints -superclass textarea -parameter { {rows 5} } -extend_slot_default validator form_constraints - # the form_constraints checker is defined already on the ::xowiki::Page level + # + # The form_constraints checker is defined on the + # ::xowiki::Page level as validate=form_constraints + # ########################################################### Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.368.2.52 -r1.368.2.53 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 26 Nov 2019 12:54:00 -0000 1.368.2.52 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 26 Jan 2020 16:48:40 -0000 1.368.2.53 @@ -2891,10 +2891,12 @@ set f [::xowiki::formfield::submit_button new -destroy_on_cleanup \ -name __form_button_ok \ -CSSclass $CSSclass] - - ::html::div -class [$f form_button_wrapper_CSSclass] { - $f render_input - } + + ::html::div [expr {[$f exists form_button_wrapper_CSSclass] + ? [list class [$f form_button_wrapper_CSSclass]] + : {} }] { + $f render_input + } } FormPage instproc form_fields_sanity_check {form_fields} {