PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TLinkButton

TLinkButton class

TLinkButton creates a hyperlink style button on the page. TLinkButton has the same appearance as a hyperlink. However, it is mainly used to submit data to a page. Like TButton, you can create either a submit button or a command button.

A command button has a command name (specified by the setCommandName CommandName property) and and a command parameter (specified by 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 onCommand OnCommand event to programmatically control the actions performed when the command button is clicked. In the event handler, you can determine the setCommandName CommandName property value and the setCommandParameter CommandParameter property value through the TCommandParameter::getName Name and TCommandParameter::getParameter Parameter properties of the event parameter which is of type TCommandEventParameter.

A submit 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 TLinkButton component is a submit button. You can provide an event handler for the onClick OnClick event to programmatically control the actions performed when the submit button is clicked.

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

TLinkButton will display the setText Text property value as the hyperlink text. If setText Text is empty, the body content of TLinkButton will be displayed. Therefore, you can use TLinkButton as an image button by enclosing an <img> tag as the body of TLinkButton.

TComponent
Extended by TApplicationComponent
Extended by TControl implements IRenderable, IBindable
Extended by TWebControl implements IStyleable
Extended by TLinkButton implements IPostBackEventHandler, IButtonControl, IDataRenderer

Direct known subclasses

TActiveLinkButton
Package: System\Web\UI\WebControls
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Web/UI/WebControls/TLinkButton.php
Methods summary
protected string
# getTagName( )

Returns

string
tag name of the button

Overrides

TWebControl::getTagName()
public boolean
# getEnableClientScript( )

Returns

boolean
whether to render javascript.
public
# setEnableClientScript( boolean $value )

Parameters

$value
boolean
whether to render javascript.
protected
# addAttributesToRender( THtmlWriter $writer )

Adds attribute name-value pairs to renderer. This overrides the parent implementation with additional button specific attributes.

Adds attribute name-value pairs to renderer. This overrides the parent implementation with additional button specific attributes.

Parameters

$writer
THtmlWriter
the writer used for the rendering purpose

Overrides

TWebControl::addAttributesToRender()
protected
# renderClientControlScript( THtmlWriter $writer )

Renders the client-script code.

Renders the client-script code.

Parameters

$writer
THtmlWriter
renderer
public
# setIsDefaultButton( boolean $value )

Parameters

$value
boolean
set by a panel to register this button as the default button for the panel.

Implementation of

IButtonControl::setIsDefaultButton()
public boolean
# getIsDefaultButton( )

Returns

boolean
true if this button is registered as a default button for a panel.

Implementation of

IButtonControl::getIsDefaultButton()
protected
# renderLinkButtonHref( THtmlWriter $writer )

Renders the Href for link button.

Renders the Href for link button.

Parameters

$writer
THtmlWriter
renderer
protected string
# getClientClassName( )

Gets the name of the javascript class responsible for performing postback for this control. This method overrides the parent implementation.

Gets the name of the javascript class responsible for performing postback for this control. This method overrides the parent implementation.

Returns

string
the javascript class name
protected array
# getPostBackOptions( )

Returns postback specifications for the button. This method is used by framework and control developers.

Returns postback specifications for the button. This method is used by framework and control developers.

Returns

array
parameters about how the button defines its postback behavior.
public
# renderContents( THtmlWriter $writer )

Renders the body content enclosed between the control tag. If getText Text is not empty, it will be rendered. Otherwise, the body content enclosed in the control tag will be rendered.

Renders the body content enclosed between the control tag. If getText Text is not empty, it will be rendered. Otherwise, the body content enclosed in the control tag will be rendered.

Parameters

$writer
THtmlWriter
the writer used for the rendering purpose

Overrides

TWebControl::renderContents()
public string
# getText( )

Returns

string
the text caption of the button

Implementation of

IButtonControl::getText()
public
# setText( string $value )

Parameters

$value
string
the text caption to be set

Implementation of

IButtonControl::setText()
public string
# getData( )

Returns the caption of the button. This method is required by IDataRenderer. It is the same as TLinkButton::getText().

Returns the caption of the button. This method is required by IDataRenderer. It is the same as TLinkButton::getText().

Returns

string
caption of the button.

Since

3.1.0

See

TLinkButton::getText()

Implementation of

IDataRenderer::getData()
public
# setData( string $value )

Sets the caption of the button. This method is required by IDataRenderer. It is the same as TLinkButton::setText().

Sets the caption of the button. This method is required by IDataRenderer. It is the same as TLinkButton::setText().

Parameters

$value
string
caption of the button

Since

3.1.0

See

TLinkButton::setText()

Implementation of

IDataRenderer::setData()
public string
# getCommandName( )

Returns

string
the command name associated with the onCommand OnCommand event.

Implementation of

IButtonControl::getCommandName()
public
# setCommandName( string $value )

Parameters

$value
string
the command name associated with the onCommand OnCommand event.

Implementation of

IButtonControl::setCommandName()
public string
# getCommandParameter( )

Returns

string
the parameter associated with the onCommand OnCommand event

Implementation of

IButtonControl::getCommandParameter()
public
# setCommandParameter( string $value )

Parameters

$value
string
the parameter associated with the onCommand OnCommand event.

Implementation of

IButtonControl::setCommandParameter()
public boolean
# getCausesValidation( )

Returns

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

Implementation of

IButtonControl::getCausesValidation()
public
# setCausesValidation( string $value )

Sets the value indicating whether postback event trigger by this button will cause input validation.

Sets the value indicating whether postback event trigger by this button will cause input validation.

Parameters

$value
string
the text caption to be set

Implementation of

IButtonControl::setCausesValidation()
public string
# getValidationGroup( )

Returns

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

Implementation of

IButtonControl::getValidationGroup()
public
# setValidationGroup( string $value )

Parameters

$value
string
the group of validators which the button causes validation upon postback

Implementation of

IButtonControl::setValidationGroup()
public
# raisePostBackEvent( TEventParameter $param )

Raises the postback event. This method is required by IPostBackEventHandler interface. If getCausesValidation CausesValidation is true, it will invoke the page's TPage::validate validate method first. It will raise onClick OnClick and onCommand OnCommand events. This method is mainly used by framework and control developers.

Raises the postback event. This method is required by IPostBackEventHandler interface. If getCausesValidation CausesValidation is true, it will invoke the page's TPage::validate validate method first. It will raise onClick OnClick and onCommand OnCommand events. This method is mainly used by framework and control developers.

Parameters

$param
TEventParameter
the event parameter

Implementation of

IPostBackEventHandler::raisePostBackEvent()
public
# onClick( TEventParameter $param )

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.

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.

Parameters

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

Implementation of

IButtonControl::onClick()
public
# onCommand( TCommandEventParameter $param )

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.

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.

Parameters

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

Implementation of

IButtonControl::onCommand()
Methods inherited from TWebControl
clearStyle(), copyBaseAttributes(), createStyle(), getAccessKey(), getBackColor(), getBorderColor(), getBorderStyle(), getBorderWidth(), getCssClass(), getDecorator(), getDisplay(), getEnsureId(), getFont(), getForeColor(), getHasStyle(), getHeight(), getStyle(), getTabIndex(), getToolTip(), getWidth(), onPreRender(), render(), renderBeginTag(), renderEndTag(), setAccessKey(), setBackColor(), setBorderColor(), setBorderStyle(), setBorderWidth(), setCssClass(), setDisplay(), setEnsureId(), setForeColor(), setHeight(), setStyle(), setTabIndex(), setToolTip(), setWidth()
Methods inherited from TControl
__construct(), __get(), addParsedObject(), addToPostDataLoader(), addedControl(), applyStyleSheetSkin(), autoBindProperty(), autoDataBindProperties(), bindProperty(), broadcastEvent(), bubbleEvent(), clearChildState(), clearControlState(), clearNamingContainer(), clearViewState(), convertUniqueIdToClientId(), createChildControls(), createControlCollection(), dataBind(), dataBindChildren(), dataBindProperties(), ensureChildControls(), findControl(), findControlsByID(), findControlsByType(), focus(), getAdapter(), getAllowChildControls(), getAttribute(), getAttributes(), getChildControlsCreated(), getClientID(), getControlStage(), getControlState(), getControls(), getCustomData(), getEnableTheming(), getEnableViewState(), getEnabled(), getHasAdapter(), getHasAttributes(), getHasChildInitialized(), getHasControls(), getHasInitialized(), getHasLoaded(), getHasLoadedPostData(), getHasPreRendered(), getID(), getIsSkinApplied(), getNamingContainer(), getPage(), getParent(), getRegisteredObject(), getSkinID(), getSourceTemplateControl(), getTemplateControl(), getUniqueID(), getViewState(), getVisible(), hasAttribute(), initRecursive(), isDescendentOf(), isObjectRegistered(), loadRecursive(), loadState(), loadStateRecursive(), onDataBinding(), onInit(), onLoad(), onUnload(), preRenderRecursive(), raiseBubbleEvent(), registerObject(), removeAttribute(), removedControl(), renderChildren(), renderControl(), saveState(), saveStateRecursive(), setAdapter(), setAttribute(), setChildControlsCreated(), setControlStage(), setControlState(), setCustomData(), setEnableTheming(), setEnableViewState(), setEnabled(), setID(), setPage(), setSkinID(), setTemplateControl(), setViewState(), setVisible(), trackViewState(), traverseChildControls(), unbindProperty(), unloadRecursive(), unregisterObject()
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __destruct(), __isset(), __set(), __sleep(), __unset(), __wakeup(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TControl
AUTOMATIC_ID_PREFIX, CLIENT_ID_SEPARATOR, CS_CHILD_INITIALIZED, CS_CONSTRUCTED, CS_INITIALIZED, CS_LOADED, CS_PRERENDERED, CS_STATE_LOADED, ID_FORMAT, ID_SEPARATOR, IS_CHILD_CREATED, IS_CREATING_CHILD, IS_DISABLE_THEMING, IS_DISABLE_VIEWSTATE, IS_ID_SET, IS_SKIN_APPLIED, IS_STYLESHEET_APPLIED, RF_ADAPTER, RF_AUTO_BINDINGS, RF_CHILD_STATE, RF_CONTROLS, RF_CONTROLSTATE, RF_DATA_BINDINGS, RF_EVENTS, RF_NAMED_CONTROLS, RF_NAMED_CONTROLS_ID, RF_NAMED_OBJECTS, RF_SKIN_ID
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Properties inherited from TWebControl
$_decorator
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO