xowiki::FormPage instproc set_property (public)

 <instance of xowiki::FormPage[i]> set_property [ -new new ] name \
    value

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

Stores a value as FormPage property

Switches:
-new
(defaults to "0") (optional)
boolean flag telling if the property is new. Setting a value on a non-existing property without specifying this flag will result in an error.
Parameters:
name - property name. Names starting with _ indicate an object variable rather than a property stored in instance_attributes
value - property value
Returns:
value (eventually converted to a has-notation message key)

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

Testcases:
create_form_with_form_instance
Source code:
if {[string match "_*" $name]} {
  set key [string range $name 1 end]

  if {!$new && ![info exists :$key]} {
    error "property '$name' ($key) does not exist.  you might use flag '-new 1' for set_property to create new properties"
  }
  set :$key $value

} else {

  if {!$new && ![dict exists ${:instance_attributes} $name]} {
    error "property '$name' does not exist.  you might use flag '-new 1' for set_property to create new properties"
  }
  dict set :instance_attributes $name $value
}
return $value
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: