xowiki::formfield::CompoundField instproc get_named_sub_component_value (public)

 <instance of xowiki::formfield::CompoundField[i]> get_named_sub_component_value \
    [ -from_repeat ] [ -default default ] args [ args... ]

Defined in packages/xowiki/tcl/form-field-procs.tcl

Return the value of a named subcomponent. When the named subcomponent is a repeated item, and the value of the 0th element of the repeat (the template element) is omitted from the returned value.

Switches:
-from_repeat
(optional)
skip template element from repeated values
-default
(optional)
default value, when component is not found
Parameters:
args - space separated path of elements names in a potentially nested component structure (similar to dict)

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_test_items create_test_items (test xowf) xowiki::formfield::CompoundField instproc get_named_sub_component_value xowiki::formfield::CompoundField instproc get_named_sub_component_value test_create_test_items->xowiki::formfield::CompoundField instproc get_named_sub_component_value

Testcases:
create_test_items
Source code:
if {[:exists_named_sub_component {*}$args]} {
  set result [[:get_named_sub_component {*}$args] value]
  if {$from_repeat} {
    if {[lindex [split [lindex $result 0] .] end] eq "0"} {
      set result [lrange $result 2 end]
    }
  }
} else {
  set result $default
}
return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: