コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: PostLoadingTest.php プロジェクト: Nurudeen/prado
 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);
 }
コード例 #3
0
ファイル: TColorPicker.php プロジェクト: bklein01/prado
 /**
  * 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();
 }
コード例 #4
0
ファイル: TDatePicker.php プロジェクト: ullasnaidu/epro
 /**
  * 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());
 }
コード例 #5
0
ファイル: TTextBox.php プロジェクト: Nurudeen/prado
 /**
  * @return mixed safe text parser
  */
 protected function getSafeTextParser()
 {
     if (!self::$_safeTextParser) {
         self::$_safeTextParser = Prado::createComponent('System.3rdParty.SafeHtml.TSafeHtmlParser');
     }
     return self::$_safeTextParser;
 }
コード例 #6
0
 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;
 }
コード例 #7
0
ファイル: TDatePicker.php プロジェクト: quantrocket/planlogiq
 /**
  * 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();
 }
コード例 #8
0
ファイル: THtmlArea.php プロジェクト: tejdeeps/tejcs.com
 /**
  * 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);
 }
コード例 #9
0
ファイル: TInPlaceTextBox.php プロジェクト: Nurudeen/prado
 /**
  * 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);
     }
 }
コード例 #10
0
 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;
 }
コード例 #11
0
 /**
  * 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);
 }
コード例 #12
0
 /**
  * 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());
 }
コード例 #13
0
 /**
  * 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();
 }