- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::FormForm
::xowiki::FormForm create ... \
[ -f.form (default "= richtext,editor=none,height=150px") ] \
[ -f.form_constraints (default "=") ] \
[ -f.text (default "= richtext,height=150px,label=#xowiki.Form-template#") ] \
[ -field_list (default "item_id name page_order title creator text form form_constraints anon_instances description nls_language") ] \
[ -validate (default " {name {\[::xowiki::validate_name\]} {Another item with this name exists already in this folder}} {text {\[::xowiki::validate_form_text\]} {Form must contain a valid template}} {page_order {\[::xowiki::validate_form_field page_order\]} {Page Order invalid; might only contain upper and lowercase letters, underscore, digits and dots}} {form {\[::xowiki::validate_form_form\]} {Form must contain a top-level HTML form element}} {form_constraints {\[::xowiki::validate_form_field form_constraints\]} {Invalid form constraints}} ") ]
Class Relations
::xotcl::Class create ::xowiki::FormForm \ -superclass ::xowiki::PageTemplateFormMethods (to be applied on instances)
f.form (setter)
f.form_constraints (setter)
f.text (setter)
field_list (setter)
new_data (scripted)
set item_id [next] # provide unique ids and names, if form is provided # set form [${:data} set form] # if {$form ne ""} { # dom parse -simple -- [lindex $form 0] doc # $doc documentElement root # set id ID$item_id # $root setAttribute id $id # set fields [$root selectNodes "//*\[@name != ''\]"] # foreach field $fields { # $field setAttribute name $id.[$field getAttribute name] # } # # Updating is rather crude. We need the item_id in advance to fill it. # # # # into the items, but it is returned from saving the file. # :log "item_id=$item_id form=[$root asHTML] [${:data} serialize]" # ${:data} update_content [${:data} revision_id] [list [$root asHTML] [lindex $form 1] ] # } return $item_idvalidate (setter)
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables