onPreRender() публичный Метод

If your subclass overrides the onPreRender method be sure to call this method through parent::onPreRender($param); so your sub-class can be decorated, among other things.
public onPreRender ( $param )
Пример #1
0
 /**
  * Ensures any pending databind is performed.
  * This method overrides the parent implementation.
  * @param TEventParameter event parameter
  */
 public function onPreRender($param)
 {
     $this->_prerendered = true;
     $this->ensureDataBound();
     parent::onPreRender($param);
 }
Пример #2
0
 /**
  * Registers the checkbox to receive postback data during postback.
  * This is necessary because a checkbox if unchecked, when postback,
  * does not have direct mapping between post data and the checkbox name.
  *
  * This method overrides the parent implementation and is invoked before render.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     if ($this->getEnabled(true)) {
         $this->getPage()->registerRequiresPostData($this);
     }
 }
Пример #3
0
 /**
  * Performs databinding to populate data items from data source.
  * This method is invoked by {@link dataBind()}.
  * You may override this function to provide your own way of data population.
  * @param Traversable the bound data
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     $controlID = $this->getControlToPaginate();
     if (($targetControl = $this->getNamingContainer()->findControl($controlID)) === null || !$targetControl instanceof TDataBoundControl) {
         throw new TConfigurationException('pager_controltopaginate_invalid', $controlID);
     }
     if ($targetControl->getAllowPaging()) {
         $this->_pageCount = $targetControl->getPageCount();
         $this->getControls()->clear();
         $this->setPageCount($targetControl->getPageCount());
         $this->setCurrentPageIndex($targetControl->getCurrentPageIndex());
         $this->buildPager();
     } else {
         $this->_pageCount = 0;
     }
 }
Пример #4
0
 /**
  * Registers CSS and JS.
  * This method is invoked right before the control rendering, if the control is visible.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     $this->getActiveView();
     // determine the active view
     $this->registerStyleSheet();
     $page = $this->getPage();
     $page->registerRequiresPostData($this);
     $page->registerRequiresPostData($this->getClientID() . "_1");
 }
Пример #5
0
 /**
  * Checks for API keys
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     if ("" == $this->getPublicKey()) {
         throw new TConfigurationException('recaptcha_publickey_unknown');
     }
     if ("" == $this->getPrivateKey()) {
         throw new TConfigurationException('recaptcha_privatekey_unknown');
     }
     // need to register captcha fields so they will be sent back also in callbacks
     $page = $this->getPage();
     $page->registerRequiresPostData($this->getChallengeFieldName());
     $page->registerRequiresPostData($this->getResponseFieldName());
 }
Пример #6
0
 /**
  * Registers CSS and JS.
  * This method is invoked right before the control rendering, if the control is visible.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     $this->registerStyleSheet();
     $this->registerSliderClientScript();
 }
Пример #7
0
 /**
  * Registers CSS and JS.
  * This method is invoked right before the control rendering, if the control is visible.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     if ($this->getPage()->getClientSupportsJavaScript()) {
         $this->registerStyleSheet();
         $this->registerClientScript();
     }
 }
Пример #8
0
 /**
  * Sets Enctype of the form on the page.
  * This method overrides the parent implementation and is invoked before render.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     if (($form = $this->getPage()->getForm()) !== null) {
         $form->setEnctype('multipart/form-data');
     }
     $this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE', $this->getMaxFileSize());
     if ($this->getEnabled(true)) {
         $this->getPage()->registerRequiresPostData($this);
     }
 }
Пример #9
0
 /**
  * Registers CSS and JS.
  * This method is invoked right before the control rendering, if the control is visible.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     $this->getActiveView();
     // determine the active view
     $this->registerStyleSheet();
 }