%3 ::xowiki::FormForm ::xowiki::FormForm new_data ::xowiki::PageTemplateForm ::xowiki::PageTemplateForm ::xowiki::FormForm->::xowiki::PageTemplateForm ::xowiki::WikiForm ::xowiki::WikiForm after_submit data_from_form edit_data edit_request mkFields new_data new_request on_submit tidy update_references ::xowiki::PageTemplateForm->::xowiki::WikiForm ::Generic::Form ::Generic::Form ::xowiki::WikiForm->::Generic::Form

Class ::xowiki::FormForm

::xowiki::FormForm[i] 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

  • class: ::xotcl::Class[i]
  • superclass: ::xowiki::PageTemplateForm[i]
::xotcl::Class create ::xowiki::FormForm \
     -superclass ::xowiki::PageTemplateForm

Methods (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_id
  • validate (setter)