[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/Web/UI/WebControls/ -> TButton.php (sommaire)

TButton class file.

Author: Qiang Xue <qiang.xue@gmail.com>
Copyright: Copyright © 2005 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TButton.php 1397 2006-09-07 07:55:53Z wei $
Poids: 294 lignes (10 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 2 classes

TButton:: (21 méthodes):
  getTagName()
  addAttributesToRender()
  canCauseValidation()
  needPostBackScript()
  getPostBackOptions()
  renderContents()
  onClick()
  onCommand()
  raisePostBackEvent()
  getText()
  setText()
  getCausesValidation()
  setCausesValidation()
  getCommandName()
  setCommandName()
  getCommandParameter()
  setCommandParameter()
  getValidationGroup()
  setValidationGroup()
  getButtonType()
  setButtonType()

TButtonType:: (0 méthodes):


Classe: TButton  - X-Ref

TButton class

TButton creates a click button on the page. It is mainly used to submit data to a page.

TButton raises two server-side events, {@link onClick OnClick} and {@link onCommand OnCommand},
when it is clicked on the client-side. The difference between these two events
is that the event {@link onCommand OnCommand} is bubbled up to the button's ancestor controls.
And within the event parameter for {@link onCommand OnCommand} contains the reference
to the {@link setCommandName CommandName} and {@link setCommandParameter CommandParameter}
property values that are set for the button object. This allows you to create multiple TButton
components on a Web page and programmatically determine which one is clicked
with what parameter.

Clicking on button can also trigger form validation, if
{@link setCausesValidation CausesValidation} is true.
The validation may be restricted within a certain group of validator
controls by setting {@link setValidationGroup ValidationGroup} property.
If validation is successful, the data will be post back to the same page.

TButton displays the {@link setText Text} property as the button caption.

TButton can be one of three {@link setButtonType ButtonType}: Submit, Button and Reset.
By default, it is a Submit button and the form submission uses the browser's
default submission capability. If it is Button or Reset, postback may occur
if one of the following conditions is met:
- an event handler is attached to {@link onClick OnClick} event;
- an event handler is attached to {@link onCommand OnCommand} event;
- the button is in a non-empty validation group.
In addition, clicking on a Reset button will clear up all input fields
if the button does not cause a postback.

getTagName()   X-Ref

return: string tag name of the button

addAttributesToRender($writer)   X-Ref
Adds attribute name-value pairs to renderer.
This overrides the parent implementation with additional button specific attributes.

param: THtmlWriter the writer used for the rendering purpose

canCauseValidation()   X-Ref

return: boolean whether to perform validation if the button is clicked

needPostBackScript()   X-Ref

return: boolean whether the button needs javascript to do postback

getPostBackOptions()   X-Ref
Returns postback specifications for the button.
This method is used by framework and control developers.

return: array parameters about how the button defines its postback behavior.

renderContents($writer)   X-Ref
Renders the body content enclosed between the control tag.
This overrides the parent implementation with nothing to be rendered.

param: THtmlWriter the writer used for the rendering purpose

onClick($param)   X-Ref
This method is invoked when the button is clicked.
The method raises 'OnClick' event to fire up the event handlers.
If you override this method, be sure to call the parent implementation
so that the event handler can be invoked.

param: TEventParameter event parameter to be passed to the event handlers

onCommand($param)   X-Ref
This method is invoked when the button is clicked.
The method raises 'OnCommand' event to fire up the event handlers.
If you override this method, be sure to call the parent implementation
so that the event handlers can be invoked.

param: TCommandEventParameter event parameter to be passed to the event handlers

raisePostBackEvent($param)   X-Ref
Raises the postback event.
This method is required by {@link IPostBackEventHandler} interface.
If {@link getCausesValidation CausesValidation} is true, it will
invoke the page's {@link TPage::validate validate} method first.
It will raise {@link onClick OnClick} and {@link onCommand OnCommand} events.
This method is mainly used by framework and control developers.

param: TEventParameter the event parameter

getText()   X-Ref

return: string caption of the button

setText($value)   X-Ref

param: string caption of the button

getCausesValidation()   X-Ref

return: boolean whether postback event trigger by this button will cause input validation, default is true

setCausesValidation($value)   X-Ref

param: boolean whether postback event trigger by this button will cause input validation

getCommandName()   X-Ref

return: string the command name associated with the {@link onCommand OnCommand} event.

setCommandName($value)   X-Ref

param: string the command name associated with the {@link onCommand OnCommand} event.

getCommandParameter()   X-Ref

return: string the parameter associated with the {@link onCommand OnCommand} event

setCommandParameter($value)   X-Ref

param: string the parameter associated with the {@link onCommand OnCommand} event.

getValidationGroup()   X-Ref

return: string the group of validators which the button causes validation upon postback

setValidationGroup($value)   X-Ref

param: string the group of validators which the button causes validation upon postback

getButtonType()   X-Ref

return: TButtonType the type of the button. Defaults to TButtonType::Submit.

setButtonType($value)   X-Ref

param: TButtonType the type of the button.

Classe: TButtonType  - X-Ref

TButtonType class.
TButtonType defines the enumerable type for the possible types that a {@link TButton} can take.

The following enumerable values are defined:
- Submit: a normal submit button
- Reset: a reset button
- Button: a client button (normally does not perform form submission)



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7