System.Web.Services
[ class tree: System.Web.Services ] [ index: System.Web.Services ] [ all elements ]

Class: TCallbackPage

Source Location: /Web/Services/TCallbackPage.php

Class Overview

TComponent
   |
   --TControl
      |
      --TPage
         |
         --TCallbackPage

TCallbackPage page class handles component callback requests (AJAX).

Class Details

[line 66]
TCallbackPage page class handles component callback requests (AJAX).

Any component that implements ICallbackEventHandler interface must reside within a page that extends TCallbackPage. TCallbackPage implement a different page life cycle than that of the normal TPage. The lifecycle of TCallbackPage is as follows.

If the page is requested is not a service request

  • Execute the normal page lifecycles @see TPage::execute()
If the page is requested in response to a AJAX request (may be a Callback request) then
  • OnInit event
  • OnLoad event
  • ** execute service **
  • OnUnload event
  • ** flush server outputs **
If the page is requested in response to a valid Callback request, then
  • OnInit event
  • ** initialize the server request **
  • ** load post data from request **
  • load viewstate
  • load post data
  • OnLoad event
  • load post data (for newly created components during Load event)
  • ** raise callback event **
  • OnUnload event
  • ** flush server outputs **
Namespace: System.Web.UI

Properties

  • IsCallback, boolean, read-only
    Gets the value that indicates whether the current request is a client callback.
  • CallbackResponse, boolean, read-only
    Gets callback response object, such that response data and output can be overridden.
Namespace: System.Web.Services




version:  $Revision: 1.2 $ $Date: 2005/11/10 23:43:26 $
author:  Wei Zhuo<weizhuo[at]gmail[dot]com>


[ Top ]

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: TPage

TPage::__construct()
Constructor, initiates the root to itself.
TPage::attachContent()
Attaches a content control to a content placeholder.
TPage::determinePostBackMode()
Determines whether the current request is a postback.
TPage::execute()
Executes page lifecycles.
TPage::getForm()
Returns the currently attached form object.
TPage::getHead()
Returns the current page's Head object.
TPage::getMasterPage()
TPage::getMasterPageName()
TPage::getModule()
Returns the module object.
TPage::getPageName()
TPage::getPostBackClientEvent()
Returns a javascript that can be used to trigger client-side postback event.
TPage::getPostBackParameter()
TPage::getPostBackTarget()
TPage::getStage()
Returns the current life cycle the page is in.
TPage::getTheme()
TPage::getUrl()
TPage::getValidators()
TPage::handlePostBackEvent()
TPage::isArrayDeclarationRegistered()
Indicates whether the named array has been registered before.
TPage::isBeginScriptRegistered()
Indicates whether the named beginscript has been registered before.
TPage::isEndScriptRegistered()
Indicate whether the named endscript has been registered before.
TPage::isHiddenFieldRegistered()
Indicates whether the named hidden field has been registered before.
TPage::isOnSubmitStatementRegistered()
Indicates whether the named onsubmit statement has been registered before.
TPage::isPostBack()
Indicates whether the current request is a postback.
TPage::isScriptFileRegistered()
Indicates whether the named scriptfile has been registered before.
TPage::isStyleFileRegistered()
Indicates whether the named CSS style file has been registered before.
TPage::isValid()
Indicates whether all validators have successfully validated the post data.
TPage::loadPageStateFromPersistenceMedium()
Loads viewstate of the page and all its children from a persistence medium.
TPage::loadPostData()
Runs through every postdata loader to load postdata.
TPage::loadViewState()
TPage::onAuthorize()
Checks if the user is authorized to access this page.
TPage::onInitRecursive()
TPage::onLoadRecursive()
TPage::onPreInit()
TPage::onPreRenderRecursive()
TPage::onUnloadRecursive()
TPage::raisePostDataChangedEvents()
Raises PostDataChanged event for each postdata loader whose data is changed.
TPage::registerArrayDeclaration()
Register an element of a javascript array to be created on client side.
TPage::registerBeginScript()
Registers a javascript block to be rendered right after the openning form element.
TPage::registerClientScript()
TPage::registerContentPlaceHolder()
Registers a content placeholder with the page.
TPage::registerEndScript()
Register a javascript block to be rendered right before the closing form element.
TPage::registerHiddenField()
Registers a hidden field to be submitted upon client postback event.
TPage::registerOnSubmitStatement()
Registers a javascript statement to be executed upon client postback event.
TPage::registerPostBackCandidate()
Registers a postback event handler.
TPage::registerPostDataLoader()
Registers a postdata loader.
TPage::registerScriptFile()
Registers a javascript file to be loaded in client side
TPage::registerStyleFile()
Registers a CSS style file to be imported with the page body
TPage::registerValidator()
Registers a validator with the page.
TPage::registerViewState()
Registers the viewstate into each form so that regardless of which
TPage::renderBody()
Renders the body content.
TPage::renderContent()
TPage::savePageStateToPersistenceMedium()
Saves viewstate of the page and all its children to a persistence medium.
TPage::saveViewState()
TPage::setForm()
Attaches the form object to the page.
TPage::setHead()
sets the current page's Head object.
TPage::setMasterPageName()
Sets the master page name.
TPage::setModule()
Sets the module object.
TPage::setPostBackParameter()
Sets postback parameter
TPage::setPostBackTarget()
Sets postback target by its unique ID
TPage::setTheme()
TPage::unregisterContentPlaceHolder()
Unregisters a content placeholder with the page.
TPage::unregisterPostBackCandidate()
Unregisters a postback handler from the page.
TPage::unregisterPostDataLoader()
Unregister a postdata loader from the page.
TPage::unregisterValidator()
Unregisters a validator from the page.
TPage::unsetForm()
Detaches the form object from the page.
TPage::validate()
Invokes validate() method of every registered validator and update isValid accordingly.

Class: TControl

TControl::__construct()
Constructor.
TControl::addBody()
Appends an object into the body collection of this control.
TControl::addParsedObject()
Adds the object parsed in template as a body of the component.
TControl::allowBody()
Determines whether the control can add the object as a body.
TControl::clearViewState()
Clears viewstate
TControl::findBodyControl()
TControl::getAttribute()
TControl::getAttributes()
Returns the attribute list object.
TControl::getAttributesToRender()
Returns attributes to be rendered.
TControl::getBodies()
TControl::getClientID()
Returns the client ID of the component.
TControl::getContainer()
Returns the container of this component.
TControl::getSkinName()
TControl::getTagName()
TControl::getViewState()
Returns a viewstate value.
TControl::initSkin()
Initializes a skin for the control. If a skin name is provided then that skin will be loaded.
TControl::isViewStateEnabled()
TControl::isVisible()
This method checks whether a control is visible.
TControl::loadViewState()
Loads viewstate into this component and its children.
TControl::onBubbleEvent()
This method responds to a bubbled event.
TControl::onInit()
This method is invoked when the control enters 'Init' stage.
TControl::onInitRecursive()
Calls onInit of this control and its children recursively.
TControl::onLoad()
This method is invoked when the control enters 'Load' stage.
TControl::onLoadRecursive()
Calls onLoad of this control and its children recursively.
TControl::onPreRender()
This method is invoked when the control enters 'PreRender' stage.
TControl::onPreRenderRecursive()
Calls onPreRender of this control and its children recursively.
TControl::onUnload()
This method is invoked when the control enters 'Unload' stage.
TControl::onUnloadRecursive()
Calls onUnload of this control and its children recursively.
TControl::raiseBubbleEvent()
Invokes the parent's onBubbleEvent method.
TControl::removeBodies()
Removes all body content.
TControl::render()
Renders this control.
TControl::renderAttributes()
Renders the attributes.
TControl::renderBody()
Renders the body content.
TControl::saveViewState()
Returns the viewstate of this component and its children.
TControl::setAttribute()
Sets an attribute.
TControl::setContainer()
Sets the container of this component
TControl::setEnableViewState()
TControl::setSkinName()
Sets the skin to use for this control
TControl::setTagName()
Sets the tag name.
TControl::setViewState()
Sets a viewstate value.
TControl::setVisible()
TControl::synchronizeControl()
This method should only be used by framework developer.

Class: TComponent

TComponent::__construct()
Constructor.
TComponent::addChild()
Adds a child component.
TComponent::addParsedObject()
Handles a component or string met in template.
TComponent::attachEventHandler()
Attaches a handler function to an event.
TComponent::bindProperty()
Sets up the binding between a property and an expression.
TComponent::canGetProperty()
Determines whether a property can be read.
TComponent::canSetProperty()
Determines whether a property can be written.
TComponent::createComponent()
Creates a child component.
TComponent::dataBind()
Performs the databinding for this component.
TComponent::evaluateExpression()
Evaluates a PHP expression.
TComponent::evaluateStatements()
Evaluates a list of PHP statements.
TComponent::findObject()
Finds an object by its ID path.
TComponent::getApplication()
TComponent::getChild()
TComponent::getChildren()
TComponent::getDefinition()
Returns or builds a component definition.
TComponent::getGlobalization()
Returns the Globalization instance for the application.
TComponent::getID()
TComponent::getModule()
Returns the module object that contains the component or the page containing the component.
TComponent::getPage()
TComponent::getParent()
TComponent::getPropertyInitValue()
Gets the initial value of a property.
TComponent::getPropertyType()
Returns the type of a property
TComponent::getRequest()
Returns the request object associated with application.
TComponent::getServiceManager()
Returns the service manager for this application.
TComponent::getSession()
Returns the session object associated with the application.
TComponent::getSessionState()
Returns a session variable.
TComponent::getUniqueID()
Returns the unique ID of the component.
TComponent::getUser()
Returns the user object associated with the application.
TComponent::hasChildren()
TComponent::hasEvent()
Determines whether an event is defined.
TComponent::hasProperty()
Determines whether a property is defined.
TComponent::initProperties()
Initializes the property values.
TComponent::instantiateTemplate()
Parses a template string and instantiates the content.
TComponent::onDataBinding()
This method is invoked when dataBind is invoked for the component.
TComponent::raiseEvent()
Invokes all attached event handler functions for a particular event.
TComponent::removeChild()
Removes a child component.
TComponent::removeChildren()
Removes all child components.
TComponent::setAttribute()
Sets an attribute.
TComponent::setDefinition()
Sets a component definition.
TComponent::setID()
Sets a component ID.
TComponent::setParent()
Sets the parent of this component.
TComponent::setPropertyInitValue()
Sets the initial value of a property.
TComponent::setRoot()
Sets the root component in the component hierarchy.
TComponent::setSessionState()
Sets a session variable.
TComponent::unbindProperty()
Breaks the binding between a property and an expression.
TComponent::__get()
Returns a property value by name or a child component by ID.
TComponent::__set()
Sets value of a component property.

Class Methods


constructor __construct [line 84]

TCallbackPage __construct( )

Initialize the callback service.



access:  public


Overrides TPage::__construct() (Constructor, initiates the root to itself.)

[ Top ]

method execute [line 155]

void execute( )

Executes page lifecycles for a callback request

If the page is requested is not a service request

  • Execute the normal page lifecycles @see TPage::execute()
If the page is requested in response to a AJAX request (may be a Callback request) then
  • OnInit event
  • OnLoad event
  • ** execute service **
  • OnUnload event
  • ** flush server outputs **
If the page is requested in response to a valid Callback request, then
  • OnInit event
  • ** initialize the server request **
  • ** load post data from request **
  • load viewstate
  • load post data
  • OnLoad event
  • load post data (for newly created components during Load event)
  • ** raise callback event **
  • OnUnload event
  • ** flush server outputs **




access:  public
see:  TPage::execute()


Overrides TPage::execute() (Executes page lifecycles.)

[ Top ]

method getCallbackID [line 327]

return getCallbackID( parameter $control)

Get the callback ID from controls that implements ICallbackEventHandler



access:  protected


Parameters:

parameter   $control  

[ Top ]

method getCallbackReference [line 307]

string getCallbackReference( ICallbackEventHandler $control, [mixed $args = null], [string $onSuccess = null])

Returns the callback javascript reference.



return:  javascript callback code.
access:  public


Parameters:

ICallbackEventHandler   $control   control
mixed   $args   callback parameters
string   $onSuccess   client-side onSuccess function

[ Top ]

method getCallbackResponse [line 295]

TCallbackResponse getCallbackResponse( )

Returns the callback response.



access:  public


[ Top ]

method getCallbackService [line 121]

TService_Callback getCallbackService( )

Gets the callback service handler.



access:  protected


[ Top ]

method handleCallback [line 219]

void handleCallback( mixed $param)

Handle the callback request, dispatch the corresponding callback events.



access:  public


Parameters:

mixed   $param   callback request parameter

[ Top ]

method initCallbackService [line 94]

void initCallbackService( )

Creates a new Callback service. Sets the service URI and add callback server to the service list.



access:  protected


[ Top ]

method isCallback [line 209]

boolean isCallback( )

Returns true if serving a valid callback request.



return:  true if valid callback request, false otherwise
access:  public


[ Top ]

method onPreRender [line 233]

void onPreRender( TEventParameter $param)

Register the callback script file.



access:  protected


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

Parameters:

TEventParameter   $param   pre-render parameters

[ Top ]

method registerCallbackCandidate [line 252]

void registerCallbackCandidate( ICallbackEventHandler $control)

Register controls that can handle callbacks. Controls that implement ICallbackEventHandler are automatically added during component registration.



access:  public


Parameters:

ICallbackEventHandler   $control   a control that can handle callback.

[ Top ]

method registerPostDataLoader [line 273]

void registerPostDataLoader( IPostBackDataHandler $control)

Registers a postdata loader. This allows the callback request to collect the form inputs.

The control must implement IPostBackDataHandler interface.




access:  public


Overrides TPage::registerPostDataLoader() (Registers a postdata loader.)

Parameters:

IPostBackDataHandler   $control   the control that wants to load postback data

[ Top ]

method unregisterCallbackCandidate [line 261]

void unregisterCallbackCandidate( ICallbackEventHandler $control)

Remove the control from the list of callback candidates.



access:  public


Parameters:

ICallbackEventHandler   $control   the control to remove.

[ Top ]

method unregisterPostDataLoader [line 284]

void unregisterPostDataLoader( TControl $control)

Unregister a postdata loader from the page.



access:  public


Overrides TPage::unregisterPostDataLoader() (Unregister a postdata loader from the page.)

Parameters:

TControl   $control   the post data loader control

[ Top ]


© 2004-2005 PRADO Software Group. All Rights Reserved.