|
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
-
TApplicationComponent
-
TControl
implements
IRenderable,
IBindable
-
TWebControl
implements
IStyleable
-
TLinkButton
implements
IPostBackEventHandler,
IButtonControl,
IDataRenderer
Methods summary
protected
string
|
#
getTagName( )
Returns
string tag name of the button
Overrides
|
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
|
protected
|
#
renderClientControlScript( THtmlWriter $writer )
Renders the client-script code.
Renders the client-script code.
Parameters
|
public
|
#
setIsDefaultButton( boolean $value )
Parameters
- $value
boolean set by a panel to register this button as the default button for the panel.
Implementation of
|
public
boolean
|
#
getIsDefaultButton( )
Returns
boolean true if this button is registered as a default button for a panel.
Implementation of
|
protected
|
#
renderLinkButtonHref( THtmlWriter $writer )
Renders the Href for link button.
Renders the Href for link button.
Parameters
|
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
|
public
string
|
#
getText( )
Returns
string the text caption of the button
Implementation of
|
public
|
#
setText( string $value )
Parameters
- $value
string the text caption to be set
Implementation of
|
public
string
|
#
getData( )
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
Implementation of
|
public
|
#
setData( string $value )
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
Implementation of
|
public
string
|
#
getCommandName( )
Returns
string the command name associated with the onCommand OnCommand event.
Implementation of
|
public
|
#
setCommandName( string $value )
Parameters
- $value
string the command name associated with the onCommand OnCommand event.
Implementation of
|
public
string
|
#
getCommandParameter( )
Returns
string the parameter associated with the onCommand OnCommand event
Implementation of
|
public
|
#
setCommandParameter( string $value )
Parameters
- $value
string the parameter associated with the onCommand OnCommand event.
Implementation of
|
public
boolean
|
#
getCausesValidation( )
Returns
boolean whether postback event trigger by this button will cause input validation
Implementation of
|
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
|
public
string
|
#
getValidationGroup( )
Returns
string the group of validators which the button causes validation upon postback
Implementation of
|
public
|
#
setValidationGroup( string $value )
Parameters
- $value
string the group of validators which the button causes validation upon postback
Implementation of
|
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
Implementation of
|
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
Implementation of
|
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
Implementation of
|
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 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
|
|