xowiki::formfield::dict_to_fc (public)

 xowiki::formfield::dict_to_fc [ -name name ] [ -type type ] dict

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

Convert the provided dict into form_constraint syntax (comma separated). The other direction would be more complex, since the fcs are interpreted from left to right, overwriting potentially previous values. The fc-interpretation creates already the form fields, produces intended errors, when certain attributes are not allowed, etc.

Switches:
-name
(optional)
optional form-field name
-type
(optional)
type of the form-field; if not specified, take it from key "_type" of the dict
Parameters:
dict - dict to be converted.

Partial Call Graph (max 5 caller/called nodes):
%3 test_dict_to_xx dict_to_xx (test xowiki) xowiki::formfield::dict_to_fc xowiki::formfield::dict_to_fc test_dict_to_xx->xowiki::formfield::dict_to_fc xowiki::formfield::dict_to_spec xowiki::formfield::dict_to_spec (public) xowiki::formfield::dict_to_spec->xowiki::formfield::dict_to_fc

Testcases:
dict_to_xx
Source code:
    if {![info exists type]} {
      set type [dict get $dict _type]
      dict unset dict _type
    }
    set list $type
    foreach {key value} $dict {
      lappend list $key=[::xowiki::formfield::FormField fc_encode $value]
    }
    if {[info exists name]} {
      return $name:[info exists name]
    } else {
      return [join $list ,]
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: