/** * Ensure that the ID attribute is rendered and registers the javascript code * for initializing the active control. */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $writer->addAttribute('id', $this->getClientID()); $this->renderLinkButtonHref($writer); $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions()); }
/** * Instantiates the template. * It creates a {@link TLinkButton}. * @param TControl parent to hold the content within the template */ public function instantiateIn($parent) { $button = new TLinkButton(); $button->setID(TWizard::ID_SIDEBAR_BUTTON); $parent->getControls()->add($button); }
/** * Ensures that the anchor is rendered correctly when its Enabled property * changes in a callback * @param bool enabled */ public function setEnabled($value) { parent::setEnabled($value); if ($this->getActiveControl()->canUpdateClientSide()) { if ($this->getEnabled(true)) { $nop = "javascript:;//" . $this->getClientID(); $this->getPage()->getCallbackClient()->setAttribute($this, 'href', $nop); $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions()); } else { $this->getPage()->getCallbackClient()->setAttribute($this, 'href', false); } } }