Index: openacs-4/packages/xowiki/tcl/repeat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/repeat-procs.tcl,v diff -u -r1.5.2.2 -r1.5.2.3 --- openacs-4/packages/xowiki/tcl/repeat-procs.tcl 23 Nov 2016 13:45:53 -0000 1.5.2.2 +++ openacs-4/packages/xowiki/tcl/repeat-procs.tcl 24 Nov 2016 09:04:40 -0000 1.5.2.3 @@ -98,10 +98,21 @@ # # Add max content items (1 .. max) and build form fields # - set max [my max] - #set max 1 ;# dynamic repeat fields: one might set max to 1 to force repeat fields to be created dynamically (missing js support) + set formAction [${:object} form_parameter __form_action {}] + if {$formAction eq ""} { + # + # The form field is in input mode; as long there is no js + # support do incrementally add form fields in js, we have to + # generate it here. + # + set max [my max] + } else { + #set max [my max] + set max 1 ;# use dynamic repeat fields: if set to 1, repeat fields will be created on demand + } + ns_log notice "MAX=$max FORMACTION <$formAction>" for {set i 1} {$i <= $max} {incr i} { - lappend components [my component_item_spec $i $itemSpec $isRequired] + lappend components [my component_item_spec $i $itemSpec $isRequired] } my create_components $components Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.485.2.34 -r1.485.2.35 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 23 Nov 2016 21:21:02 -0000 1.485.2.34 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 24 Nov 2016 09:04:40 -0000 1.485.2.35 @@ -2758,6 +2758,10 @@ set $marker 1 } + Page instproc form_field_exists {name} { + return [info exists ::_form_field_names($name)] + } + Page instproc lookup_form_field { -name:required form_fields 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.327.2.26 -r1.327.2.27 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 14 Oct 2016 18:58:53 -0000 1.327.2.26 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 24 Nov 2016 09:04:40 -0000 1.327.2.27 @@ -665,7 +665,9 @@ } } - if {$fs_folder_id ne ""} {lappend folder_spec folder_id $fs_folder_id} + if {$fs_folder_id ne ""} { + lappend folder_spec folder_id $fs_folder_id + } [$object_type getFormClass -data [self]] create ::xowiki::f1 -volatile \ -action [export_vars -base [$package_id url] $action_vars] \ @@ -879,9 +881,8 @@ #my log "__redirect_method=$redirect_method" return [my www-view] } else { - # - # display the current values + # Build the input form and display the current values. # if {[my is_new_entry [my name]]} { my set creator [::xo::get_user_name [::xo::cc user_id]] @@ -929,7 +930,6 @@ $ff(_nls_language) set transmit_field_always 1 } - # some final sanity checks my form_fields_sanity_check $form_fields my post_process_form_fields $form_fields @@ -2285,9 +2285,15 @@ set form_fields [my create_category_fields] foreach att $field_names { if {[string match "__*" $att]} continue - lappend form_fields [my create_form_field \ - -cr_field_spec [my get_short_spec @cr_fields] \ - -field_spec [my get_short_spec @fields] $att] + + if {[:form_field_exists $att]} { + #ns_log notice "... found [set $key] for $key" + lappend form_fields [:lookup_form_field $att {}] + } else { + lappend form_fields [my create_form_field \ + -cr_field_spec [my get_short_spec @cr_fields] \ + -field_spec [my get_short_spec @fields] $att] + } } return $form_fields }