%3 ::xotcl::Object ::xotcl::Object ::Generic::Form ::Generic::Form generate ::Generic::Form->::xotcl::Object ::xowiki::WikiForm ::xowiki::WikiForm ::xowiki::WikiForm->::Generic::Form ::xowiki::PlainWikiForm ::xowiki::PlainWikiForm ::xowiki::PlainWikiForm->::xowiki::WikiForm ::xowiki::PageInstanceEditForm ::xowiki::PageInstanceEditForm ::xowiki::PageInstanceEditForm->::xowiki::WikiForm ::xowiki::PageTemplateForm ::xowiki::PageTemplateForm ::xowiki::PageTemplateForm->::xowiki::WikiForm ::xowiki::PageInstanceForm ::xowiki::PageInstanceForm ::xowiki::PageInstanceForm->::xowiki::WikiForm ::xowiki::FileForm ::xowiki::FileForm ::xowiki::FileForm->::xowiki::WikiForm

Class ::Generic::Form

::Generic::Form[i] create ... \
           [ -action (default "[::xo::cc url]") ] \
           [ -add_page_title add_page_title ] \
           [ -data data ] \
           [ -edit_page_title edit_page_title ] \
           [ -fields fields ] \
           [ -folder_id (default "-100") ] \
           [ -html (default "") ] \
           [ -name (default "[namespace tail [self]]") ] \
           [ -package_id (default "") ] \
           [ -submit_link (default ".") ] \
           [ -validate (default "") ] \
           [ -with_categories (default "false") ]

This class was designed together with the content repository class ::xo::db::CrClass for the generation of HTML forms, but it can be used also with different classes. The only hard requirement is the presence of an 'item_id' form field. For generic acs_objects, 'item_id' will correspond to 'object_id' column in 'acs_objects' table. For content repository items, 'item_id' will be the column by the same name in cr_revisions/cr_items.

Documented Parameters:
page title when adding content items
page title when editing content items
data object (e.g. instance if CrItem)
associated folder id. Will default to data's 'parent_id' variable. If 'parent_id' is missing too, package's 'folder_id' will be used.
name of the form, used for naming the template, defaults to the object name
package_id of the object. Will default to data's 'package_id' variable
link for page after submit
display form with categories (default false)
Defined in packages/xotcl-core/tcl/generic-procs.tcl

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xotcl::Object[i]
  • subclass: ::xowiki::WikiForm[i]

Methods (to be applied on instances)

  • generate (scripted, public)

     <instance of Generic::Form[i]> generate [ -template template ] \
        [ -mode mode ] [ -export export ]

    The method generate is used to actually generate the form template from the specifications and to set up page_title and context when appropriate.

    (defaults to "formTemplate") (optional)
    is the name of the Tcl variable to contain the filled in template
    (defaults to "edit") (optional)
    list of attribute value pairs to be exported to the form (nested list)

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_xowiki_test_cases xowiki_test_cases (test xowiki) Generic::Form instproc generate Generic::Form instproc generate test_xowiki_test_cases->Generic::Form instproc generate ad_form ad_form (public) Generic::Form instproc generate->ad_form category::ad_form::add_widgets category::ad_form::add_widgets (public) Generic::Form instproc generate->category::ad_form::add_widgets category::ad_form::fill_widgets category::ad_form::fill_widgets (public) Generic::Form instproc generate->category::ad_form::fill_widgets category::ad_form::get_categories category::ad_form::get_categories (public) Generic::Form instproc generate->category::ad_form::get_categories category::map_object category::map_object (public) Generic::Form instproc generate->category::map_object