[ 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/ -> TImageButton.php (sommaire)

TImageButton class file

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

Définit 2 classes

TImageButton:: (21 méthodes):
  getTagName()
  addAttributesToRender()
  canCauseValidation()
  getPostBackOptions()
  loadPostData()
  raisePostDataChangedEvent()
  onClick()
  onCommand()
  raisePostBackEvent()
  getCausesValidation()
  setCausesValidation()
  getCommandName()
  setCommandName()
  getCommandParameter()
  setCommandParameter()
  getValidationGroup()
  setValidationGroup()
  getText()
  setText()
  onPreRender()
  renderContents()

TImageClickEventParameter:: (5 méthodes):
  __construct()
  getX()
  setX()
  getY()
  setY()


Classe: TImageButton  - X-Ref

TImageButton class

TImageButton creates an image button on the page. It is used to submit data to a page.
You can create either a <b>submit</b> button or a <b>command</b> button.

A <b>command</b> button has a command name (specified by
the {@link setCommandName CommandName} property) and and a command parameter
(specified by {@link setCommandParameter CommandParameter} property)
associated with the button. This allows you to create multiple TLinkButton
components on a Web page and programmatically determine which one is clicked
with what parameter. You can provide an event handler for
{@link onCommand OnCommand} event to programmatically control the actions performed
when the command button is clicked. In the event handler, you can determine
the {@link setCommandName CommandName} property value and
the {@link setCommandParameter CommandParameter} property value
through the {@link TCommandParameter::getName Name} and
{@link TCommandParameter::getParameter Parameter} properties of the event
parameter which is of type {@link TCommandEventParameter}.

A <b>submit</b> button does not have a command name associated with the button
and clicking on it simply posts the Web page back to the server.
By default, a TImageButton control is a submit button.
You can provide an event handler for the {@link onClick OnClick} event
to programmatically control the actions performed when the submit button is clicked.
The coordinates of the clicking point can be obtained from the {@link onClick OnClick}
event parameter, which is of type {@link TImageClickEventParameter}.

Clicking on button can trigger form validation, if
{@link setCausesValidation CausesValidation} is true.
And 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.

TImageButton displays the {@link setText Text} property as the hint text to the displayed image.

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

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.

loadPostData($key,$values)   X-Ref
This method checks if the TImageButton is clicked and loads the coordinates of the clicking position.
This method is primarly used by framework developers.

param: string the key that can be used to retrieve data from the input data collection
param: array the input data collection
return: boolean whether the data of the component has been changed

raisePostDataChangedEvent()   X-Ref
A dummy implementation for the IPostBackDataHandler interface.


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: TImageClickEventParameter 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

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

getText()   X-Ref

return: string caption of the button

setText($value)   X-Ref

param: string caption of the button

onPreRender($param)   X-Ref
Registers the image button to receive postback data during postback.
This is necessary because an image button, when postback, does not have
direct mapping between post data and the image button name.
This method overrides the parent implementation and is invoked before render.

param: mixed event parameter

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

Classe: TImageClickEventParameter  - X-Ref

TImageClickEventParameter class

TImageClickEventParameter encapsulates the parameter data for
{@link TImageButton::onClick Click} event of {@link TImageButton} controls.

__construct($x,$y)   X-Ref
Constructor.

param: integer X coordinate of the clicking point
param: integer Y coordinate of the clicking point

getX()   X-Ref

return: integer X coordinate of the clicking point, defaults to 0

setX($value)   X-Ref

param: integer X coordinate of the clicking point

getY()   X-Ref

return: integer Y coordinate of the clicking point, defaults to 0

setY($value)   X-Ref

param: integer Y coordinate of the clicking point



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