## 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: $Id: TForm.php 2056 2007-07-17 17:43:16Z xue $
- 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 107)

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

string getDefaultButton ()
getEnctype (line 142)

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

string getEnctype ()
getMethod (line 126)

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

string getMethod ()
getName (line 162)

- 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 72)

Renders the form.

- access: public

void render (THtmlWriter $writer)

- THtmlWriter $writer: writer

Redefinition of:

TControl::render()
  Renders the control.

setDefaultButton (line 118)

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 154)

- 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 134)

- 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::addToPostDataLoader()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::bubbleEvent()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::convertUniqueIdToClientId()
> TControl::createChildControls()
> TControl::createControlCollection()
> 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::getCustomData()
> TControl::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasChildInitialized()
> TControl::getHasControls()
> TControl::getHasInitialized()
> TControl::getHasLoaded()
> TControl::getHasLoadedPostData()
> TControl::getHasPreRendered()
> 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::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::setCustomData()
> TControl::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> TControl::trackViewState()
> 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::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> 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

> TControl::AUTOMATIC_ID_PREFIX
> TControl::CLIENT_ID_SEPARATOR
> TControl::CS_CHILD_INITIALIZED
> TControl::CS_CONSTRUCTED
> TControl::CS_INITIALIZED
> TControl::CS_LOADED
> TControl::CS_PRERENDERED
> TControl::CS_STATE_LOADED
> TControl::ID_FORMAT
> TControl::ID_SEPARATOR
> TControl::IS_CHILD_CREATED
> TControl::IS_CREATING_CHILD
> TControl::IS_DISABLE_THEMING
> TControl::IS_DISABLE_VIEWSTATE
> TControl::IS_ID_SET
> TControl::IS_SKIN_APPLIED
> TControl::IS_STYLESHEET_APPLIED
> TControl::RF_ADAPTER
> TControl::RF_AUTO_BINDINGS
> TControl::RF_CHILD_STATE
> TControl::RF_CONTROLS
> TControl::RF_CONTROLSTATE
> TControl::RF_DATA_BINDINGS
> TControl::RF_EVENTS
> TControl::RF_NAMED_CONTROLS
> TControl::RF_NAMED_CONTROLS_ID
> TControl::RF_NAMED_OBJECTS
> TControl::RF_SKIN_ID

Documentation generated on Mon, 21 Apr 2008 11:35:03 -0400 by phpDocumentor 1.3.0RC4