xowiki::FormPage instproc combine_data_and_form_field_default (public)

 <instance of xowiki::FormPage[i]> combine_data_and_form_field_default \
    is_new form_field data_value

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

Combine the value of the form field (e.g. determined by the default) with the value in the instance attributes. This function decides, whether it should honor the data value or the form field value for e.g. rendering forms.

Parameters:
is_new - is this a new entry?
form_field - object id of the form field
data_value - the data from the instance attributes.

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 combine_data_and_form_field_default xowiki::FormPage instproc combine_data_and_form_field_default test_create_form_with_form_instance->xowiki::FormPage instproc combine_data_and_form_field_default

Testcases:
create_form_with_form_instance
Source code:
set form_field_value [$form_field value]
if {$is_new && $form_field_value ne "" && $data_value eq ""} {
  #
  # On fresh entries, take the default value in case the old
  # value is blank.
  #
} else {
  #
  # Reset for form field value to the external
  # representation of the data value.
  #
  $form_field value [$form_field convert_to_external $data_value]
}
#ns_log notice "combine_data_and_form_field_default $is_new form_field [$form_field name] data_value <$data_value> final <[$form_field value]>"
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: