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 TCallbackClientScript

TCallbackClientScript class.

The TCallbackClientScript class provides corresponding methods that can be executed on the client-side (i.e. the browser client that is viewing the page) during a callback response.

The avaiable methods includes setting/clicking input elements, changing Css styles, hiding/showing elements, and adding visual effects to elements on the page. The client-side methods can be access through the CallbackClient property available in TPage.

For example, to hide "$myTextBox" element during callback response, do

$this->getPage()->getCallbackClient()->hide($myTextBox);
TComponent
Extended by TApplicationComponent
Extended by TCallbackClientScript
Package: System\Web\UI\ActiveControls
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizhuo[at]gamil[dot]com>
Since: 3.1
Located at Web/UI/ActiveControls/TCallbackClientScript.php
Methods summary
public
# __construct( )

Constructor.

Constructor.

Overrides

TComponent::__construct()
public array
# getClientFunctionsToExecute( )

Returns

array
list of client function to be executed during callback response.
public
# callClientFunction( string $function, array $params = null )

Executes a client-side statement.

Executes a client-side statement.

Parameters

$function
string
javascript function name
$params
array
list of arguments for the function
public
# setValue( TControl $input, string $text )

Client script to set the value of a particular input element.

Client script to set the value of a particular input element.

Parameters

$input
TControl
control element to set the new value
$text
string
new value
public
# select( TControl $control, string $method = 'Value', string|integer $value = null, string $type = null )

Client script to select/clear/check a drop down list, check box list, or radio button list. The second parameter determines the selection method. Valid methods are
- Value, select or check by value
- Values, select or check by a list of values
- Index, select or check by index (zero based index)
- Indices, select or check by a list of index (zero based index)
- Clear, clears or selections or checks in the list
- All, select all
- Invert, invert the selection.

Client script to select/clear/check a drop down list, check box list, or radio button list. The second parameter determines the selection method. Valid methods are - Value, select or check by value - Values, select or check by a list of values - Index, select or check by index (zero based index) - Indices, select or check by a list of index (zero based index) - Clear, clears or selections or checks in the list - All, select all - Invert, invert the selection.

Parameters

$control
TControl
list control
$method
string
selection method
$value
string|integer
the value or index to select/check.
$type
string
selection control type, either 'check' or 'select'
public
# click( TControl $control )

Client script to click on an element. This client-side function is unpredictable.

Client script to click on an element. This client-side function is unpredictable.

Parameters

$control
TControl
control element or element id
public
# check( TControl $checkbox, boolean $checked = true )

Client script to check or uncheck a checkbox or radio button.

Client script to check or uncheck a checkbox or radio button.

Parameters

$checkbox
TControl
control element or element id
$checked
boolean
check or uncheck the checkbox or radio button.
public
# raiseClientEvent( TControl $control, string $eventName )

Raise the client side event (given by $eventName) on a particular element.

Raise the client side event (given by $eventName) on a particular element.

Parameters

$control
TControl
control element or element id
$eventName
string
Event name, e.g. "click"
public
# setAttribute( TControl $control, string $name, string $value )

Sets the attribute of a particular control.

Sets the attribute of a particular control.

Parameters

$control
TControl
control element or element id
$name
string
attribute name
$value
string
attribute value
public
# setListItems( TControl $control, TCollection $items )

Sets the options of a select input element.

Sets the options of a select input element.

Parameters

$control
TControl
control element or element id
$items
TCollection
a list of new options
public
# show( TControl $element )

Shows an element by changing its CSS display style as empty.

Shows an element by changing its CSS display style as empty.

Parameters

$element
TControl
control element or element id
public
# hide( TControl $element )

Hides an element by changing its CSS display style to "none".

Hides an element by changing its CSS display style to "none".

Parameters

$element
TControl
control element or element id
public
# toggle( TControl $element, string $effect = null, array $options = array() )

Toggles the visibility of the element.

Toggles the visibility of the element.

Parameters

$element
TControl
control element or element id
$effect
string
visual effect, such as, 'appear' or 'slide' or 'blind'.
$options
array
additional options.
public
# remove( TControl $element )

Removes an element from the HTML page.

Removes an element from the HTML page.

Parameters

$element
TControl
control element or element id
public
# addPostDataLoader( mixed $name )
public
# update( TControl $element, TControl $content )

Update the element's innerHTML with new content.

Update the element's innerHTML with new content.

Parameters

$element
TControl
control element or element id
$content
TControl
new HTML content, if content is of a TControl, the controls render method is called.
public
# addCssClass( TControl $element, string $cssClass )

Add a Css class name to the element.

Add a Css class name to the element.

Parameters

$element
TControl
control element or element id
$cssClass
string
CssClass name to add.
public
# removeCssClass( TControl $element, string $cssClass )

Remove a Css class name from the element.

Remove a Css class name from the element.

Parameters

$element
TControl
control element or element id
$cssClass
string
CssClass name to remove.
public
# scrollTo( TControl $element )

Scroll the top of the browser viewing area to the location of the element.

Scroll the top of the browser viewing area to the location of the element.

Parameters

$element
TControl
control element or element id
public
# focus( TControl $element )

Focus on a particular element.

Focus on a particular element.

Parameters

$element
TControl
control element or element id.
public
# setStyle( TControl $element, array $styles )

Sets the style of element. The style must be a key-value array where the key is the style property and the value is the style value.

Sets the style of element. The style must be a key-value array where the key is the style property and the value is the style value.

Parameters

$element
TControl
control element or element id
$styles
array
list of key-value pairs as style property and style value.
public
# appendContent( TControl $element, string $content )

Append a HTML fragement to the element.

Append a HTML fragement to the element.

Parameters

$element
TControl
control element or element id
$content
string
HTML fragement or the control to be rendered
public
# prependContent( TControl $element, string $content )

Prepend a HTML fragement to the element.

Prepend a HTML fragement to the element.

Parameters

$element
TControl
control element or element id
$content
string
HTML fragement or the control to be rendered
public
# insertContentAfter( TControl $element, string $content )

Insert a HTML fragement after the element.

Insert a HTML fragement after the element.

Parameters

$element
TControl
control element or element id
$content
string
HTML fragement or the control to be rendered
public
# insertContentBefore( TControl $element, string $content )

Insert a HTML fragement in before the element.

Insert a HTML fragement in before the element.

Parameters

$element
TControl
control element or element id
$content
string
HTML fragement or the control to be rendered
protected
# replace( TControl $element, string $content, string $method = "Element.replace", string $boundary = null )

Replace the content of an element with new content. The new content can be a string or a TControl component. If the content parameter is a TControl component, its rendered method will be called and its contents will be used for replacement.

Replace the content of an element with new content. The new content can be a string or a TControl component. If the content parameter is a TControl component, its rendered method will be called and its contents will be used for replacement.

Parameters

$element
TControl
control element or HTML element id.
$content
string
HTML fragement or the control to be rendered
$method
string
replacement method, default is to replace the outter html content.
$boundary
string
provide a custom boundary.

See

insertAbout
insertBelow
insertBefore
insertAfter
public
# replaceContent( TControl $element, string $content )

Replace the content of an element with new content contained in writer.

Replace the content of an element with new content contained in writer.

Parameters

$element
TControl
control element or HTML element id.
$content
string
HTML fragement or the control to be rendered
public
# evaluateScript( THtmlWriter $writer )

Evaluate a block of javascript enclosed in a boundary.

Evaluate a block of javascript enclosed in a boundary.

Parameters

$writer
THtmlWriter
writer for the content.
public
# appendScriptBlock( THtmlWriter $content )

Appends a block of inline javascript enclosed in a boundary. Similar to to evaluateScript(), but functions declared in the inline block will be available to page elements.

Appends a block of inline javascript enclosed in a boundary. Similar to to evaluateScript(), but functions declared in the inline block will be available to page elements.

Parameters

$content
THtmlWriter
writer for the content.
public
# visualEffect( string $type, TControl $element, array $options = null )

Add a visual effect the element.

Add a visual effect the element.

Parameters

$type
string
visual effect function name.
$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# appear( TControl $element, array $options = null )

Visual Effect: Gradually make the element appear.

Visual Effect: Gradually make the element appear.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# blindDown( TControl $element, array $options = null )

Visual Effect: Blind down.

Visual Effect: Blind down.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# blindUp( TControl $element, array $options = null )

Visual Effect: Blind up.

Visual Effect: Blind up.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# dropOut( TControl $element, array $options = null )

Visual Effect: Drop out.

Visual Effect: Drop out.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# fade( TControl $element, array $options = null )

Visual Effect: Gradually fade the element.

Visual Effect: Gradually fade the element.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# fold( TControl $element, array $options = null )

Visual Effect: Fold.

Visual Effect: Fold.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# grow( TControl $element, array $options = null )

Visual Effect: Gradually make an element grow to a predetermined size.

Visual Effect: Gradually make an element grow to a predetermined size.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# puff( TControl $element, array $options = null )

Visual Effect: Gradually grow and fade the element.

Visual Effect: Gradually grow and fade the element.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# pulsate( TControl $element, array $options = null )

Visual Effect: Pulsate.

Visual Effect: Pulsate.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# shake( TControl $element, array $options = null )

Visual Effect: Shake the element.

Visual Effect: Shake the element.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# shrink( TControl $element, array $options = null )

Visual Effect: Shrink the element.

Visual Effect: Shrink the element.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# slideDown( TControl $element, array $options = null )

Visual Effect: Slide down.

Visual Effect: Slide down.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# slideUp( TControl $element, array $options = null )

Visual Effect: Side up.

Visual Effect: Side up.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# squish( TControl $element, array $options = null )

Visual Effect: Squish the element.

Visual Effect: Squish the element.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# switchOff( TControl $element, array $options = null )

Visual Effect: Switch Off effect.

Visual Effect: Switch Off effect.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# highlight( TControl $element, array $options = null )

Visual Effect: High light the element for about 2 seconds.

Visual Effect: High light the element for about 2 seconds.

Parameters

$element
TControl
control element or element id
$options
array
visual effect key-value pair options.
public
# setOpacity( TControl $element, float $value )

Set the opacity on a html element or control.

Set the opacity on a html element or control.

Parameters

$element
TControl
control element or element id
$value
float
opacity value between 1 and 0
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), 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 TComponent
GLOBAL_RAISE_EVENT_LISTENER
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