Class TPage

Description

TPage class

  • author: Qiang Xue <qiang.xue@gmail.com>
  • version: $Id: TPage.php 3162 2012-06-04 13:19:53Z ctrlaltca $
  • since: 3.0

Located in /Web/UI/TPage.php (line 29)

TComponent
   |
   --TApplicationComponent
      |
      --TControl
         |
         --TCompositeControl
            |
            --TTemplateControl
               |
               --TPage
Class Constant Summary
 FIELD_CALLBACK_PARAMETER = 'PRADO_CALLBACK_PARAMETER'
 FIELD_CALLBACK_TARGET = 'PRADO_CALLBACK_TARGET'
 FIELD_LASTFOCUS = 'PRADO_LASTFOCUS'
 FIELD_PAGESTATE = 'PRADO_PAGESTATE'
 FIELD_POSTBACK_PARAMETER = 'PRADO_POSTBACK_PARAMETER'
 FIELD_POSTBACK_TARGET = 'PRADO_POSTBACK_TARGET'
Variable Summary
Method Summary
static void decodeUTF8 ( $data,  $enc)
void applyControlSkin (TControl $control)
void applyControlStyleSheet (TControl $control)
void beginFormRender ( $writer)
void endFormRender ( $writer)
void ensureRenderInForm (TControl $control)
TPage __construct ()
void flushWriter ()
string getClientState ()
boolean getInFormRender ()
boolean getIsCallback ()
boolean getIsPostBack ()
boolean getIsValid ()
string getPagePath ()
string getTitle ()
TList getValidators ([string $validationGroup = null])
boolean isSystemPostField (string $field)
void loadPageState ()
void loadState ()
void onInitComplete (mixed $param)
void onLoadComplete (mixed $param)
void onPreInit (mixed $param)
void onPreLoad (mixed $param)
void onPreRenderComplete (mixed $param)
void onSaveStateComplete (mixed $param)
void processCallbackRequest ( $writer)
void processNormalRequest ( $writer)
void processPostBackRequest ( $writer)
void processPostData (TMap $postData, boolean $beforeLoad)
void registerCachingAction (string $context, string $funcName, array $funcParams)
void registerPostDataLoader (TControl $control)
void run (THtmlTextWriter $writer)
void savePageState ()
void saveState ()
void setCallbackEventParameter (mixed $value)
void setCallbackEventTarget (TControl $control)
void setClientState (string $state)
void setClientSupportsJavaScript (boolean $value)
void setEnableStateCompression (boolean $value)
void setEnableStateEncryption (boolean $value)
void setEnableStateValidation (boolean $value)
void setFocus (TControl|string $value)
void setForm (TForm $form)
void setHead (THead $value)
void setPagePath (string $value)
void setPostBackEventParameter (string $value)
void setPostBackEventTarget (TControl $control)
void setStatePersisterClass (string $value)
void setStyleSheetTheme (string|TTheme $value)
void setTheme (string|TTheme $value)
void setTitle (string $value)
void validate ([string $validationGroup = null])
Variables
array $_controlsPostDataChanged = array() (line 95)
  • var: list of controls whose data have been changed due to the postback
  • access: protected
array $_controlsRegisteredForPostData = array() (line 103)
  • var: list of controls that need to load post data in the next postback
  • access: protected
array $_controlsRequiringPostData = array() (line 99)
  • var: list of controls that need to load post data in the current request
  • access: protected
boolean $_formRendered = false (line 115)
  • var: whether the form has been rendered
  • access: protected
boolean $_inFormRender = false (line 119)
  • var: whether the current rendering is within a form
  • access: protected
boolean $_isLoadingPostData = false (line 164)
  • var: true if loading post data.
  • access: protected
TMap $_postData (line 87)
  • var: data post back by user
  • access: protected
array $_postDataLoaders = array() (line 160)
  • var: post data loader IDs.
  • access: protected
TMap $_restPostData (line 91)
  • var: postback data that is not handled during first invocation of LoadPostData.
  • access: protected
Methods
static method decodeUTF8 (line 287)
  • access: protected
static void decodeUTF8 ( $data,  $enc)
  • $data
  • $enc
applyControlSkin (line 588)

Applies a skin in the current theme to a control.

This method should only be used by framework developers.

  • access: public
void applyControlSkin (TControl $control)
  • TControl $control: a control to be applied skin with
applyControlStyleSheet (line 599)

Applies a stylesheet skin in the current theme to a control.

This method should only be used by framework developers.

  • access: public
void applyControlStyleSheet (TControl $control)
  • TControl $control: a control to be applied stylesheet skin with
beginFormRender (line 977)
  • access: public
void beginFormRender ( $writer)
  • $writer
endFormRender (line 989)
  • access: public
void endFormRender ( $writer)
  • $writer
ensureRenderInForm (line 968)

Ensures the control is rendered within a form.

  • throws: TConfigurationException if the control is outside of the form
  • access: public
void ensureRenderInForm (TControl $control)
  • TControl $control: the control to be rendered
Constructor __construct (line 179)

Constructor.

Sets the page object to itself. Derived classes must call parent implementation.

  • access: public
TPage __construct ()

Redefinition of:
TControl::__construct()
Constructor.
flushWriter (line 1234)

Flushes output

  • access: public
void flushWriter ()
getCachingStack (line 1224)
TStack getCachingStack ()
getCallbackClient (line 377)

Gets the callback client script handler that allows javascript functions to be executed during the callback response.

  • return: interface to client-side javascript code.
  • access: public
TCallbackClientScript getCallbackClient ()
getCallbackEventParameter (line 416)

Callback parameter is decoded assuming JSON encoding.

  • return: callback event parameter
  • access: public
string getCallbackEventParameter ()
getCallbackEventTarget (line 398)
  • return: the control responsible for the current callback event, null if nonexistent
  • access: public
TControl getCallbackEventTarget ()
getClientScript (line 608)
  • return: client script manager
  • access: public
TClientScriptManager getClientScript ()
getClientState (line 1083)

Returns the state to be stored on the client side.

This method should only be used by framework and control developers.

  • return: the state to be stored on the client side
  • access: public
string getClientState ()
getClientSupportsJavaScript (line 1016)
  • return: whether client supports javascript. Defaults to true.
  • access: public
boolean getClientSupportsJavaScript ()
getEnableStateCompression (line 1173)
  • return: whether page state should be compressed. Defaults to true.
  • since: 3.1.6
  • access: public
boolean getEnableStateCompression ()
getEnableStateEncryption (line 1156)
  • return: whether page state should be encrypted. Defaults to false.
  • access: public
boolean getEnableStateEncryption ()
getEnableStateValidation (line 1140)
  • return: whether page state should be HMAC validated. Defaults to true.
  • access: public
boolean getEnableStateValidation ()
getForm (line 453)
  • return: the form on the page
  • access: public
TForm getForm ()
getHead (line 1032)
  • return: page head, null if not available
  • access: public
THead getHead ()
getInFormRender (line 958)
  • return: Whether form rendering is in progress
  • access: public
boolean getInFormRender ()
getIsCallback (line 761)
  • return: whether this is a callback request
  • access: public
boolean getIsCallback ()
getIsLoadingPostData (line 930)
  • return: true if loading post data.
  • access: public
boolean getIsLoadingPostData ()
getIsPostBack (line 753)
  • return: whether the current page request is a postback
  • access: public
boolean getIsPostBack ()
getIsValid (line 528)

Returns whether user input is valid or not.

This method must be invoked after validate is called.

  • return: whether the user input is valid or not.
  • throws: TInvalidOperationException if validate is not invoked yet.
  • access: public
boolean getIsValid ()
getPagePath (line 1190)
  • return: the requested page path for this page
  • access: public
string getPagePath ()
getPostBackEventParameter (line 860)
  • return: postback event parameter
  • access: public
string getPostBackEventParameter ()
getPostBackEventTarget (line 837)
  • return: the control responsible for the current postback event, null if nonexistent
  • access: public
TControl getPostBackEventTarget ()
getPostDataLoaders (line 445)

Get a list of IDs of controls that are enabled and require post data.

  • return: list of IDs implementing IPostBackDataHandler
  • access: public
array getPostDataLoaders ()
getRequestClientState (line 1101)
  • return: the state postback from client side
  • access: public
string getRequestClientState ()
getStatePersister (line 1125)
  • return: page state persister
  • access: public
IPageStatePersister getStatePersister ()
getStatePersisterClass (line 1109)
  • return: class name of the page state persister. Defaults to TPageStatePersister.
  • access: public
string getStatePersisterClass ()
getStyleSheetTheme (line 567)
  • return: the stylesheet theme used for the page. Defaults to null.
  • access: public
TTheme getStyleSheetTheme ()
getTheme (line 547)
  • return: the theme used for the page. Defaults to null.
  • access: public
TTheme getTheme ()
getTitle (line 1056)
  • return: page title.
  • access: public
string getTitle ()
getValidators (line 478)

Returns a list of registered validators.

If validation group is specified, only the validators in that group will be returned.

  • return: registered validators in the requested group. If the group is null, all validators will be returned.
  • access: public
TList getValidators ([string $validationGroup = null])
  • string $validationGroup: validation group
isSystemPostField (line 812)
  • return: whether the specified field is a system field in postback data
  • access: protected
boolean isSystemPostField (string $field)
  • string $field: the field name
loadPageState (line 791)

Loads page state from persistent storage.

  • access: protected
void loadPageState ()
loadState (line 782)

This method is invoked right after the control has loaded its state.

You can override this method to initialize data from the control state. Parent implementation must be invoked.

  • access: public
void loadState ()

Redefinition of:
TControl::loadState()
This method is invoked right after the control has loaded its state.
onInitComplete (line 646)

Raises OnInitComplete event.

This method is invoked right after OnInit stage and before OnLoad stage. You may override this method to provide additional initialization that should be done after OnInit. Remember to call the parent implementation to ensure OnInitComplete event is raised.

  • access: public
void onInitComplete (mixed $param)
  • mixed $param: event parameter
onLoadComplete (line 672)

Raises OnLoadComplete event.

This method is invoked right after OnLoad stage. You may override this method to provide additional page loading logic that should be done after OnLoad. Remember to call the parent implementation to ensure OnLoadComplete event is raised.

  • access: public
void onLoadComplete (mixed $param)
  • mixed $param: event parameter
onPreInit (line 633)

Raises OnPreInit event.

This method is invoked right before OnInit stage. You may override this method to provide additional initialization that should be done before OnInit (e.g. setting Theme or StyleSheetTheme). Remember to call the parent implementation to ensure OnPreInit event is raised.

  • access: public
void onPreInit (mixed $param)
  • mixed $param: event parameter
onPreLoad (line 659)

Raises OnPreLoad event.

This method is invoked right before OnLoad stage. You may override this method to provide additional page loading logic that should be done before OnLoad. Remember to call the parent implementation to ensure OnPreLoad event is raised.

  • access: public
void onPreLoad (mixed $param)
  • mixed $param: event parameter
onPreRenderComplete (line 685)

Raises OnPreRenderComplete event.

This method is invoked right after OnPreRender stage. You may override this method to provide additional preparation for page rendering that should be done after OnPreRender. Remember to call the parent implementation to ensure OnPreRenderComplete event is raised.

  • access: public
void onPreRenderComplete (mixed $param)
  • mixed $param: event parameter
onSaveStateComplete (line 734)

Raises OnSaveStateComplete event.

This method is invoked right after onSaveState stage. You may override this method to provide additional logic after page state is saved. Remember to call the parent implementation to ensure OnSaveStateComplete event is raised.

  • access: public
void onSaveStateComplete (mixed $param)
  • mixed $param: event parameter
processCallbackRequest (line 305)

Sets Adapter to TActivePageAdapter and calls apter to process the callback request.

  • access: protected
void processCallbackRequest ( $writer)
  • $writer
processNormalRequest (line 208)
  • access: protected
void processNormalRequest ( $writer)
  • $writer
processPostBackRequest (line 242)
  • access: protected
void processPostBackRequest ( $writer)
  • $writer
processPostData (line 883)

Processes post data.

  • access: protected
void processPostData (TMap $postData, boolean $beforeLoad)
  • TMap $postData: post data to be processed
  • boolean $beforeLoad: whether this method is invoked before OnLoad.
raiseChangedEvents (line 938)

Raises OnPostDataChangedEvent for controls whose data have been changed due to the postback.

  • access: protected
void raiseChangedEvents ()
raisePostBackEvent (line 947)

Raises PostBack event.

  • access: protected
void raisePostBackEvent ()
registerCachingAction (line 1212)

Registers an action associated with the content being cached.

The registered action will be replayed if the content stored in the cache is served to end-users.

  • access: public
void registerCachingAction (string $context, string $funcName, array $funcParams)
  • string $context: context of the action method. This is a property-path referring to the context object (e.g. Page, Page.ClientScript).
  • string $funcName: method name of the context object
  • array $funcParams: list of parameters to be passed to the action method
registerPostDataLoader (line 435)

Register post data loaders for Callback to collect post data.

This method should only be called by framework developers.

  • see: TControl::preRenderRecursive();
  • access: public
void registerPostDataLoader (TControl $control)
  • TControl $control: control that requires post data.
registerRequiresPostData (line 824)

Registers a control for loading post data in the next postback.

This method needs to be invoked if the control to load post data may not have a post variable in some cases. For example, a checkbox, if not checked, will not have a post value.

  • access: public
void registerRequiresPostData (TControl $control)
  • TControl $control: control registered for loading post data
run (line 188)

Runs through the page lifecycles.

  • access: public
void run (THtmlTextWriter $writer)
  • THtmlTextWriter $writer: the HTML writer
savePageState (line 801)

Saves page state from persistent storage.

  • access: protected
void savePageState ()
saveState (line 771)

This method is invoked when control state is to be saved.

You can override this method to do last step state saving. Parent implementation must be invoked.

  • access: public
void saveState ()

Redefinition of:
TControl::saveState()
This method is invoked when control state is to be saved.
setCallbackClient (line 389)

Set a new callback client handler.

  • access: public
void setCallbackClient (TCallbackClientScript $client)
setCallbackEventParameter (line 424)
  • access: public
void setCallbackEventParameter (mixed $value)
  • mixed $value: callback event parameter
setCallbackEventTarget (line 407)

Registers a control to raise callback event in the current request.

  • access: public
void setCallbackEventTarget (TControl $control)
  • TControl $control: control registered to raise callback event.
setClientState (line 1093)

Sets the state to be stored on the client side.

This method should only be used by framework and control developers.

  • access: public
void setClientState (string $state)
  • string $state: the state to be stored on the client side
setClientSupportsJavaScript (line 1024)
  • access: public
void setClientSupportsJavaScript (boolean $value)
  • boolean $value: whether client supports javascript. If false, javascript will not be generated for controls.
setEnableStateCompression (line 1182)
  • since: 3.1.6
  • access: public
void setEnableStateCompression (boolean $value)
  • boolean $value: whether page state should be compressed.
setEnableStateEncryption (line 1164)
  • access: public
void setEnableStateEncryption (boolean $value)
  • boolean $value: whether page state should be encrypted.
setEnableStateValidation (line 1148)
  • access: public
void setEnableStateValidation (boolean $value)
  • boolean $value: whether page state should be HMAC validated.
setFocus (line 1008)

Sets input focus on a control after the page is rendered to users.

  • access: public
void setFocus (TControl|string $value)
  • TControl|string $value: control to receive focus, or the ID of the element on the page to receive focus
setForm (line 464)

Registers a TForm instance to the page.

Note, a page can contain at most one TForm instance.

  • throws: TInvalidOperationException if this method is invoked twice or more.
  • access: public
void setForm (TForm $form)
  • TForm $form: the form on the page
setHead (line 1041)
  • throws: TInvalidOperationException if a head already exists
  • access: public
void setHead (THead $value)
  • THead $value: page head
setPagePath (line 1198)
  • access: public
void setPagePath (string $value)
  • string $value: the requested page path for this page
setPostBackEventParameter (line 873)
  • access: public
void setPostBackEventParameter (string $value)
  • string $value: postback event parameter
setPostBackEventTarget (line 852)

Registers a control to raise postback event in the current request.

  • access: public
void setPostBackEventTarget (TControl $control)
  • TControl $control: control registered to raise postback event.
setStatePersisterClass (line 1117)
  • access: public
void setStatePersisterClass (string $value)
  • string $value: class name of the page state persister.
setStyleSheetTheme (line 578)

Sets the stylesheet theme to be used for the page.

  • access: public
void setStyleSheetTheme (string|TTheme $value)
  • string|TTheme $value: the stylesheet theme name or the stylesheet theme object to be used for the page.
setTheme (line 558)

Sets the theme to be used for the page.

  • access: public
void setTheme (string|TTheme $value)
  • string|TTheme $value: the theme name or the theme object to be used for the page.
setTitle (line 1070)

Sets the page title.

Note, a THead control needs to place on the page in order that this title be rendered.

  • access: public
void setTitle (string $value)
  • string $value: page title. This will override the title set in Head.
validate (line 500)

Performs input validation.

This method will invoke the registered validators to perform the actual validation. If validation group is specified, only the validators in that group will be invoked.

  • access: public
void validate ([string $validationGroup = null])
  • string $validationGroup: validation group. If null, all validators will perform validation.

Inherited Methods

Inherited From TTemplateControl

TTemplateControl::createChildControls()
TTemplateControl::getIsSourceTemplateControl()
TTemplateControl::getMaster()
TTemplateControl::getMasterClass()
TTemplateControl::getTemplate()
TTemplateControl::getTemplateDirectory()
TTemplateControl::initRecursive()
TTemplateControl::injectContent()
TTemplateControl::loadTemplate()
TTemplateControl::registerContent()
TTemplateControl::registerContentPlaceHolder()
TTemplateControl::setMasterClass()
TTemplateControl::setTemplate()

Inherited From TCompositeControl

TCompositeControl::initRecursive()

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::convertUniqueIdToClientId()
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::getIsSkinApplied()
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::trackViewState()
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::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()
Class Constants

Documentation generated on Mon, 25 Jun 2012 14:38:49 +0200 by phpDocumentor 1.4.3