protected function createMultiLineControl($container, $column, $record) { $value = $this->getRecordPropertyValue($column, $record); $control = new TTextBox(); $control->setText($value); $control->setTextMode(TTextBoxMode::MultiLine); $control->setCssClass('multiline-textbox scaffold_input'); $this->setNotNullProperty($container, $control, $column, $record); return $control; }
public function onInit($param) { parent::onInit($param); // Text Box $textBox = new TTextBox(); $textBox->setVisible(false); $textBox->setID("MyTextBox"); $this->panel1->getControls()->add($textBox); $this->registerObject("MyTextBox", $textBox); // Submit button $button = new TActiveButton(); $button->setVisible(false); $button->setID("MyButton"); $button->setText("Submit"); $button->attachEventHandler("OnCallback", array($this, "clickedButton")); $this->panel1->getControls()->add($button); $this->registerObject("MyButton", $button); }
/** * Renders additional body content. * This method overrides parent implementation by adding * additional color picker button. * @param THtmlWriter writer */ public function renderEndTag($writer) { parent::renderEndTag($writer); $color = $this->getText(); $writer->addAttribute('class', 'TColorPicker_button'); $writer->renderBeginTag('span'); $writer->addAttribute('id', $this->getClientID() . '_button'); $writer->addAttribute('src', $this->getAssetUrl('button.gif')); if ($color !== '') { $writer->addAttribute('style', "background-color:{$color};"); } $writer->addAttribute('width', '20'); $writer->addAttribute('height', '20'); $writer->addAttribute('alt', ''); $writer->renderBeginTag('img'); $writer->renderEndTag(); $writer->renderEndTag(); }
/** * Add the client id to the input textbox, and register the client scripts. * @param THtmlWriter writer */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $writer->addAttribute('id', $this->getClientID()); }
/** * @return mixed safe text parser */ protected function getSafeTextParser() { if (!self::$_safeTextParser) { self::$_safeTextParser = Prado::createComponent('System.3rdParty.SafeHtml.TSafeHtmlParser'); } return self::$_safeTextParser; }
public function createChildControls() { $m = new TTextBox(); $m->setId($this->_filterId ? $this->_filterId : $this->genFilterId()); $this->getControls()->add($m); $vali = new TDataTypeValidator(); $vali->setEnableClientScript(true); $vali->setDisplay('Dynamic'); $vali->setControlToValidate($m->getId()); $vali->setDataType('Date'); $vali->setDateFormat($this->_dateFormat); $vali->setText(Prado::localize('Wrong date format')); $this->createLabel($m->getId()); $this->getControls()->add($vali); $this->_control = $m; }
/** * Add the client id to the input textbox, and register the client scripts. * @param THtmlWriter writer */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $writer->addAttribute('id', $this->getClientID()); $this->registerCalendarClientScript(); }
/** * Adds attribute name-value pairs to renderer. * This method overrides the parent implementation by registering * additional javacript code. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { if ($this->getEnableVisualEdit() && $this->getEnabled(true)) { $writer->addAttribute('id', $this->getClientID()); $this->registerEditorClientScript($writer); } parent::addAttributesToRender($writer); }
/** * Update ClientSide Readonly property * @param boolean value * @since 3.1.2 */ public function setReadOnly($value) { $value = TPropertyValue::ensureBoolean($value); TTextBox::setReadOnly($value); if ($this->getActiveControl()->canUpdateClientSide()) { $this->callClientFunction('setReadOnly', $value); } }
function render() { $this->Page->registerClientScript('controls'); $this->renderJs(); $contents = parent::render(); $panel = $this->createComponent('TPanel', self::RESULT_PANEL_ID); $panel->setCssClass($this->getResultCssClass()); $contents .= $panel->render(); return $contents; }
/** * Adds attribute name-value pairs to renderer. * This method overrides the parent implementation by registering * additional javacript code. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { if ($this->getEnableVisualEdit() && $this->getEnabled(true)) { $writer->addAttribute('id', $this->getClientID()); $this->registerEditorClientScript($writer); } $this->loadJavascriptLibrary(); if ($this->getEnableCompression()) { $this->preLoadCompressedScript(); } parent::addAttributesToRender($writer); }
/** * 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->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions()); }
/** * Renders the datepicker * @return string the rendering result */ public function render() { if ($this->isShowCalendar()) { $id = $this->getClientID(); $format = $this->getDateFormat(); $showTime = $this->isShowTime() ? 'true' : 'false'; $script = "\nCalendar.setup({\n\tinputField:\"{$id}\",\n\tifFormat:\"{$format}\",\n\tshowsTime:{$showTime},\n\ttimeFormat:\"24\",\n\teventName:\"focus\"\n});\n"; $this->Page->registerEndScript($id, $script); } return parent::render(); }