## Class TForm

Description

TForm class

TForm displays an HTML form. Besides regular body content, it displays hidden fields, javascript blocks and files that are registered through TClientScriptManager.

A TForm is required for a page that needs postback. Each page can contain at most one TForm. If multiple HTML forms are needed, please use regular HTML form tags for those forms that post to different URLs.

- since: 3.0
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/TForm.php (line 30)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TForm

Method Summary
void addAttributesToRender (THtmlWriter $writer)
string getDefaultButton ()
string getEnctype ()
string getMethod ()
string getName ()
void onInit (mixed $param)
void render (THtmlWriter $writer)
void setDefaultButton (string $value)
void setEnctype (string $value)
void setMethod (string $value)
Methods
addAttributesToRender (line 46)

Adds form specific attributes to renderer.

- access: protected

void addAttributesToRender (THtmlWriter $writer)

- THtmlWriter $writer: writer

getDefaultButton (line 85)

- return: id path to the default button control.
- access: public

string getDefaultButton ()
getEnctype (line 120)

- return: the encoding type a browser uses to post data back to the server
- access: public

string getEnctype ()
getMethod (line 104)

- return: form submission method. Defaults to 'post'.
- access: public

string getMethod ()
getName (line 140)

- return: form name, which is equal to UniqueID.
- access: public

string getName ()
onInit (line 36)

Registers the form with the page.

- access: public

void onInit (mixed $param)

- mixed $param: event parameter

Redefinition of:

TControl::onInit()
  This method is invoked when the control enters 'OnInit' stage.

render (line 71)

Renders the form.

- access: public

void render (THtmlWriter $writer)

- THtmlWriter $writer: writer

Redefinition of:

TControl::render()
  Renders the control.

setDefaultButton (line 96)

Sets a button to be default one in a form.

A default button will be clicked if a user presses 'Enter' key within the form.

- access: public

void setDefaultButton (string $value)

- string $value: id path to the default button control.

setEnctype (line 132)

- access: public

void setEnctype (string $value)

- string $value: the encoding type a browser uses to post data back to the server. Commonly used types include
  - application/x-www-form-urlencoded : Form data is encoded as name/value pairs. This is the standard encoding format.
  - multipart/form-data : Form data is encoded as a message with a separate part for each control on the page.
  - text/plain : Form data is encoded in plain text, without any control or formatting characters.

setMethod (line 112)

- access: public

void setMethod (string $value)

- string $value: form submission method. Valid values include 'post' and 'get'.

#### Inherited Methods

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::broadcastEventInternal()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::createChildControls()
> TControl::createControlCollection()
> TControl::createdOnTemplate()
> TControl::dataBind()
> TControl::dataBindChildren()
> TControl::dataBindProperties()
> TControl::ensureChildControls()
> TControl::findControl()
> TControl::findControlsByID()
> TControl::findControlsByType()
> TControl::focus()
> TControl::getAdapter()
> TControl::getAllowChildControls()
> TControl::getAttribute()
> TControl::getAttributes()
> TControl::getChildControlsCreated()
> TControl::getClientID()
> TControl::getControls()
> TControl::getControlStage()
> TControl::getControlState()
> TControl::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasControls()
> TControl::getID()
> TControl::getNamingContainer()
> TControl::getPage()
> TControl::getParent()
> TControl::getRegisteredObject()
> TControl::getSkinID()
> TControl::getSourceTemplateControl()
> TControl::getTemplateControl()
> TControl::getUniqueID()
> TControl::getViewState()
> TControl::getVisible()
> TControl::hasAttribute()
> TControl::initRecursive()
> TControl::isDescendentOf()
> TControl::isObjectRegistered()
> TControl::loadRecursive()
> TControl::loadState()
> TControl::loadStateRecursive()
> TControl::onBubbleEvent()
> TControl::onDataBinding()
> TControl::onInit()
> TControl::onLoad()
> TControl::onPreRender()
> TControl::onUnload()
> TControl::preRenderRecursive()
> TControl::raiseBubbleEvent()
> TControl::registerObject()
> TControl::removeAttribute()
> TControl::removedControl()
> TControl::render()
> TControl::renderChildren()
> TControl::renderControl()
> TControl::saveState()
> TControl::saveStateRecursive()
> TControl::setAdapter()
> TControl::setAttribute()
> TControl::setChildControlsCreated()
> TControl::setControlStage()
> TControl::setControlState()
> TControl::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> TControl::traverseChildControls()
> TControl::unbindProperty()
> TControl::unloadRecursive()
> TControl::unregisterObject()
> TControl::__get()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Class Constants

#### Inherited Constants

Inherited from TControl

Documentation generated on Mon, 01 May 2006 23:03:31 -0400 by phpDocumentor 1.3.0RC4