xowiki::FormPage instproc load_values_into_form_fields (public)

 <instance of xowiki::FormPage[i]> load_values_into_form_fields \
    form_fields

Defined in packages/xowiki/tcl/xowiki-www-procs.tcl

Load either the instance variables or the instance attributes into the provided form-fields. The function sets the values based on the default values and the values for the current object.

Parameters:
form_fields

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) xowiki::FormPage instproc load_values_into_form_fields xowiki::FormPage instproc load_values_into_form_fields test_create_form_with_form_instance->xowiki::FormPage instproc load_values_into_form_fields test_create_form_with_numeric create_form_with_numeric (test xowiki) test_create_form_with_numeric->xowiki::FormPage instproc load_values_into_form_fields _ _ (public) xowiki::FormPage instproc load_values_into_form_fields->_

Testcases:
create_form_with_form_instance, create_form_with_numeric
Source code:
set is_new [:is_new_entry ${:name}]

foreach f $form_fields {
  set att [$f name]
  switch -glob $att {
    __* {}
    _* {
      set varname [string range $att 1 end]
      :combine_data_and_form_field_default $is_new $f [set :$varname]
    }
    default {
      #:log "load_values_into_form_field $att"  "exists [dict exists ${:instance_attributes} $att]"  "in [dict keys ${:instance_attributes}]"
      if {[dict exists ${:instance_attributes} $att]} {
        :combine_data_and_form_field_default $is_new $f [dict get ${:instance_attributes} $att]
      }
    }
  }
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: