%3 ::xowiki::formfield::FormField ::xowiki::formfield::FormField → fc_decode → fc_encode ::xo::tdom::Object ::xo::tdom::Object ::xowiki::formfield::FormField->::xo::tdom::Object ::xowiki::formfield::CompoundField ::xowiki::formfield::CompoundField get_named_sub_component_value ::xowiki::formfield::CompoundField->::xowiki::formfield::FormField ::xowiki::formfield::repeatContainer ::xowiki::formfield::repeatContainer ::xowiki::formfield::repeatContainer->::xowiki::formfield::CompoundField ::xowiki::formfield::regression_test_mycompound ::xowiki::formfield::regression_test_mycompound ::xowiki::formfield::regression_test_mycompound->::xowiki::formfield::CompoundField ::xowiki::formfield::text_fields ::xowiki::formfield::text_fields ::xowiki::formfield::text_fields->::xowiki::formfield::CompoundField ::xowiki::formfield::ShuffleField ::xowiki::formfield::ShuffleField ::xowiki::formfield::text_fields->::xowiki::formfield::ShuffleField ::xowiki::formfield::regression_test_compound_with_repeat2 ::xowiki::formfield::regression_test_compound_with_repeat2 ::xowiki::formfield::regression_test_compound_with_repeat2->::xowiki::formfield::CompoundField ::xowiki::formfield::mc_exercise ::xowiki::formfield::mc_exercise ::xowiki::formfield::mc_exercise->::xowiki::formfield::CompoundField ::xowiki::formfield::date ::xowiki::formfield::date ::xowiki::formfield::date->::xowiki::formfield::CompoundField ::xowiki::formfield::CalendarField ::xowiki::formfield::CalendarField ::xowiki::formfield::CalendarField->::xowiki::formfield::CompoundField ::xowiki::formfield::repeattest ::xowiki::formfield::repeattest ::xowiki::formfield::repeattest->::xowiki::formfield::CompoundField ::xowiki::formfield::mc_alternative ::xowiki::formfield::mc_alternative ::xowiki::formfield::mc_alternative->::xowiki::formfield::CompoundField ::xowiki::formfield::FormGeneratorField ::xowiki::formfield::FormGeneratorField ::xowiki::formfield::FormGeneratorField->::xowiki::formfield::CompoundField ::xowiki::formfield::regression_test_compound_with_repeat ::xowiki::formfield::regression_test_compound_with_repeat ::xowiki::formfield::regression_test_compound_with_repeat->::xowiki::formfield::CompoundField ::xowiki::formfield::regression_test_compound_numeric ::xowiki::formfield::regression_test_compound_numeric ::xowiki::formfield::regression_test_compound_numeric->::xowiki::formfield::CompoundField ::xowiki::formfield::comp_correct_when ::xowiki::formfield::comp_correct_when ::xowiki::formfield::comp_correct_when->::xowiki::formfield::CompoundField ::xowiki::formfield::time_span ::xowiki::formfield::time_span ::xowiki::formfield::time_span->::xowiki::formfield::CalendarField ::xowiki::formfield::event ::xowiki::formfield::event ::xowiki::formfield::event->::xowiki::formfield::CalendarField ::xowiki::formfield::TestItemField ::xowiki::formfield::TestItemField ::xowiki::formfield::TestItemField->::xowiki::formfield::FormGeneratorField

Class ::xowiki::formfield::CompoundField

::xowiki::formfield::CompoundField[i] create ... \
           [ -CSSclass (default "compound-field") ] \
           [ -components (default "") ]

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xowiki::formfield::FormField[i]
  • subclass: ::xowiki::formfield::repeatContainer[i], ::xowiki::formfield::regression_test_mycompound[i], ::xowiki::formfield::text_fields[i], ::xowiki::formfield::regression_test_compound_with_repeat2[i], ::xowiki::formfield::mc_exercise[i], ::xowiki::formfield::date[i], ::xowiki::formfield::CalendarField[i], ::xowiki::formfield::repeattest[i], ::xowiki::formfield::mc_alternative[i], ::xowiki::formfield::FormGeneratorField[i], ::xowiki::formfield::regression_test_compound_with_repeat[i], ::xowiki::formfield::regression_test_compound_numeric[i], ::xowiki::formfield::comp_correct_when[i]
::xotcl::Class create ::xowiki::formfield::CompoundField \
     -superclass ::xowiki::formfield::FormField

Methods (to be applied on instances)

  • get_named_sub_component_value (scripted, public)

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

    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 (required)
    space separated path of elements names in a potentially nested component structure (similar to dict)

    Testcases:
    create_test_items
    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