## Class TClientScript

Description

TClientScript class

Allows importing of Prado Client Scripts from template via the PradoScripts property. Multiple Prado client-scripts can be specified using comma delimited string of the javascript library to include on the page. For example,

     <com:TClientScript PradoScripts="effects, rico" />

Custom javascript files can be register using the ScriptUrl property.

     <com:TClientScript ScriptUrl=<%~ test.js %> />

Contents within TClientScript will be treated as javascript code and will be rendered in place.

- since: 3.0
- version: $Id: TClientScript.php 1398 2006-09-08 19:31:03Z xue $
- author: Wei Zhuo <weizhuo[at]gmail[dot]com>

Located in /Web/UI/WebControls/TClientScript.php (line 39)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TClientScript

Method Summary
string getPradoScripts ()
string getScriptUrl ()
void onPreRender (mixed $param)
void render (THtmlWriter $writer)
void renderCustomScript (THtmlWriter $writer)
void renderCustomScriptFile (THtmLWriter $writer)
void setPradoScripts (string $value)
void setScriptUrl (string $value)
Methods
getPradoScripts (line 45)

- return: comma delimited list of javascript libraries to included on the page.
- access: public

string getPradoScripts ()
getScriptUrl (line 66)

- return: custom javascript file url.
- access: public

string getScriptUrl ()
onPreRender (line 84)

Calls the client script manager to add each of the requested client script libraries.

- access: public

void onPreRender (mixed $param)

- mixed $param: event parameter

Redefinition of:

TControl::onPreRender()
  This method is invoked when the control enters 'OnPreRender' stage.

render (line 102)

Renders the body content as javascript block.

Overrides parent implementation, parent renderChildren method is called during registerCustomScript.

- access: public

void render (THtmlWriter $writer)

- THtmlWriter $writer: the renderer

Redefinition of:

TControl::render()
  Renders the control.

renderCustomScript (line 122)

Registers the body content as javascript.

- access: protected

void renderCustomScript (THtmlWriter $writer)

- THtmlWriter $writer: the renderer

renderCustomScriptFile (line 112)

Renders the custom script file.

- access: protected

void renderCustomScriptFile (THtmLWriter $writer)

- THtmLWriter $writer: the renderer

setPradoScripts (line 58)

Include javascript library to the current page. The current supported libraries are: "prado", "effects", "ajax", "validator", "logger", "datepicker", "rico", "colorpicker". Library dependencies are automatically resolved.

- access: public

void setPradoScripts (string $value)

- string $value: comma delimited list of javascript libraries to include.

setScriptUrl (line 74)

- access: public

void setScriptUrl (string $value)

- string $value: custom javascript file url.

#### Inherited Methods

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::addToPostDataLoader()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::bubbleEvent()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::createChildControls()
> TControl::createControlCollection()
> TControl::dataBind()
> TControl::dataBindChildren()
> TControl::dataBindProperties()
> TControl::ensureChildControls()
> TControl::findControl()
> TControl::findControlsByID()
> TControl::findControlsByType()
> TControl::focus()
> TControl::getAdapter()
> TControl::getAllowChildControls()
> TControl::getAttribute()
> TControl::getAttributes()
> TControl::getChildControlsCreated()
> TControl::getClientID()
> TControl::getControls()
> TControl::getControlStage()
> TControl::getControlState()
> TControl::getCustomData()
> TControl::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasChildInitialized()
> TControl::getHasControls()
> TControl::getHasInitialized()
> TControl::getHasLoaded()
> TControl::getHasLoadedPostData()
> TControl::getHasPreRendered()
> TControl::getID()
> TControl::getNamingContainer()
> TControl::getPage()
> TControl::getParent()
> TControl::getRegisteredObject()
> TControl::getSkinID()
> TControl::getSourceTemplateControl()
> TControl::getTemplateControl()
> TControl::getUniqueID()
> TControl::getViewState()
> TControl::getVisible()
> TControl::hasAttribute()
> TControl::initRecursive()
> TControl::isDescendentOf()
> TControl::isObjectRegistered()
> TControl::loadRecursive()
> TControl::loadState()
> TControl::loadStateRecursive()
> TControl::onDataBinding()
> TControl::onInit()
> TControl::onLoad()
> TControl::onPreRender()
> TControl::onUnload()
> TControl::preRenderRecursive()
> TControl::raiseBubbleEvent()
> TControl::registerObject()
> TControl::removeAttribute()
> TControl::removedControl()
> TControl::render()
> TControl::renderChildren()
> TControl::renderControl()
> TControl::saveState()
> TControl::saveStateRecursive()
> TControl::setAdapter()
> TControl::setAttribute()
> TControl::setChildControlsCreated()
> TControl::setControlStage()
> TControl::setControlState()
> TControl::setCustomData()
> TControl::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> TControl::traverseChildControls()
> TControl::unbindProperty()
> TControl::unloadRecursive()
> TControl::unregisterObject()
> TControl::__get()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Class Constants

#### Inherited Constants

Inherited from TControl

> TControl::AUTOMATIC_ID_PREFIX
> TControl::CLIENT_ID_SEPARATOR
> TControl::CS_CHILD_INITIALIZED
> TControl::CS_CONSTRUCTED
> TControl::CS_INITIALIZED
> TControl::CS_LOADED
> TControl::CS_PRERENDERED
> TControl::CS_STATE_LOADED
> TControl::ID_FORMAT
> TControl::ID_SEPARATOR
> TControl::IS_CHILD_CREATED
> TControl::IS_CREATING_CHILD
> TControl::IS_DISABLE_THEMING
> TControl::IS_DISABLE_VIEWSTATE
> TControl::IS_ID_SET
> TControl::IS_SKIN_APPLIED
> TControl::IS_STYLESHEET_APPLIED
> TControl::RF_ADAPTER
> TControl::RF_AUTO_BINDINGS
> TControl::RF_CHILD_STATE
> TControl::RF_CONTROLS
> TControl::RF_CONTROLSTATE
> TControl::RF_DATA_BINDINGS
> TControl::RF_EVENTS
> TControl::RF_NAMED_CONTROLS
> TControl::RF_NAMED_CONTROLS_ID
> TControl::RF_NAMED_OBJECTS
> TControl::RF_SKIN_ID

Documentation generated on Sun, 14 Jan 2007 21:41:32 -0500 by phpDocumentor 1.3.0RC4