xowiki::formfield::FormField instproc json_value (public)

 <instance of xowiki::formfield::FormField[i]> json_value value

Defined in /var/www/openacs/packages/xowiki/tcl/json-procs.tcl

Export a stored value as text, or as an array of strings for a multiple-value field. Unknown field types retain their text values.

Parameters:
value (required)
Stored field value.
Returns:
Two-element ns_json type/payload pair; array payloads contain triples.

Testcases:
No testcase defined.
Source code:
if {[:exists multiple] && [:set multiple]} {
    if {[catch {llength $value}]} {
        return [list string $value]}
  set entries {}
  set i 0
  foreach v $value {
    lappend entries $i string $v
    incr i
  }
  return [list array $entries]
}
return [list string $value]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: