Example #1
0
 public function onCreate()
 {
     parent::onCreate();
     $textField = new MTextField('ajaxPessoa[idPessoa]', '', 'IdPessoa');
     $this->addField(new MHContainer('ajaxPessoa', array($textField, new MContentPane('panePessoa'))));
     $textField->ajaxText('onBlur', 'ajaxPessoa/getNome', 'panePessoa');
 }
Example #2
0
 public function setValue($value)
 {
     if ($value instanceof MCurrency) {
         $value = $value->getValue($value);
     }
     parent::setValue(str_replace(',', '.', $value));
 }
Example #3
0
 public function setValue($value)
 {
     if ($value instanceof MDate || $value instanceof MTimestamp) {
         $value = $value->format();
     }
     parent::setValue($value);
 }
Example #4
0
 public function onCreate()
 {
     parent::onCreate();
     //Compatibilidade com 9 dígitos, o último é opcional
     $mask = '(##) ####-####?#';
     $this->setMask($mask);
 }
Example #5
0
 public function onCreate()
 {
     parent::onCreate();
     $this->type = 'file';
     $this->setClass('mFileField');
     $this->setRender('inputfile');
 }
Example #6
0
 public function onCreate()
 {
     parent::onCreate();
     if ($this->getClass() == '') {
         $this->setClass('mMultilineField');
     }
     $this->setRender('inputtextarea');
 }
Example #7
0
 public function generateInner()
 {
     parent::generateInner();
     if (!$this->readonly) {
         $text = $this->render();
         $this->inner = $text;
     }
 }
Example #8
0
 public function generateInner()
 {
     $id = $this->getId();
     $mv = new MVContainer();
     for ($i = 0; $i <= $this->numRows; $i++) {
         $t = array();
         $t[0] = new MDiv('', new MSpan('', $i + 1 . ":&nbsp;", 'mCaption'));
         $t[0]->width = '25px';
         for ($j = 0; $j <= $this->numCols; $j++) {
             $text = new MTextField("{$id}[{$i}][{$j}]", $this->aValue[$i][$j], '', $colWidth);
             if ($this->aMask[$i][$j] != '') {
                 $text->addMask($this->aMask[$i][$j]);
             }
             $text->setAttribute('rowNumber', "{$i}");
             $t[$j + 1] = $text;
         }
         $mh = new MHContainer('', $t);
         $mv->addControl($mh);
     }
     $this->inner = $mv;
 }
 public function generateInner()
 {
     $field = new MTextField($this->name, $this->value, '', $this->size, $this->hint, $this->validator);
     $field->setAttributes($this->attributes);
     if ($this->autocomplete) {
         $field->addEvent('change', "{$this->lookupName}.start();");
     }
     $field->setWidth($this->style->get('width'));
     $field->validator = $this->validator;
     $field->form = $this->form;
     $field->showLabel = $this->showLabel;
     if ($this->readonly) {
         $field->setClass('mReadOnly');
         $field->addAttribute('readonly');
     }
     parent::generateInner();
     $lookupField = $this->getInner();
     //$container = new MHContainer('', array($field, ( $this->readonly ? '' : $lookupField)));
     //$container->setShowLabel(false);
     $field = new MDiv('', $field, 'textfield');
     $lookup = $this->readonly ? '' : $lookupField;
     $container = new MDiv('', array($field, $lookup), 'mLookupTextField mContainer');
     //$container->setClass('mLookupField');
     $this->inner = $container;
 }
Example #10
0
 public function onCreate()
 {
     parent::onCreate();
     $this->setName($this->getId());
     $this->setDojoType('dijit.Editor');
     $this->page->addDojoRequire('dijit.Editor');
     $this->page->addDojoRequire("dijit.Toolbar");
     $this->page->addDojoRequire("dijit._editor.plugins.FontChoice");
     // 'fontName','fontSize','formatBlock'
     $this->page->addDojoRequire("dijit._editor.plugins.TextColor");
     $this->page->addDojoRequire('dojox.editor.plugins.PasteFromWord');
     $this->page->addDojoRequire("dojox.editor.plugins.TablePlugins");
     $this->page->addDojoRequire("dojox.editor.plugins.ResizeTableColumn");
     $this->attributes->dojoProps->dojoProps["extraPlugins"] = "@[\"PasteFromWord\"]";
     $this->attributes->dojoProps->dojoProps["plugins"] = "@[\"cut\",\"copy\"\n            ,\"paste\",\"|\",\"bold\",\"italic\",\"underline\",\"strikethrough\"\n            ,\"subscript\",\"superscript\",\"|\", \"indent\", \"outdent\"\n            ,\"justifyLeft\", \"justifyCenter\", \"justifyRight\",\"|\",\n            {name:\"dijit._editor.plugins.FontChoice\", command:\"fontName\", generic:true},\n            {name: \"insertTable\"},\n            {name: \"modifyTable\"},\n            {name: \"insertTableRowBefore\"},\n            {name: \"insertTableRowAfter\"},\n            {name: \"insertTableColumnBefore\"},\n            {name: \"insertTableColumnAfter\"},\n            {name: \"deleteTableRow\"},\n            {name: \"deleteTableColumn\"},\n            {name: \"colorTableCell\"},\n            {name: \"tableContextMenu\"}]";
     $urlCSS = Manager::getAbsoluteURL('public/scripts/dojox/editor/plugins/resources/editorPlugins.css');
     $this->page->addJsCode("dojo.create(\"link\", {href:'{$urlCSS}', type:'text/css', rel:'stylesheet'}, document.getElementsByTagName('head')[0]);");
     $urlPasteFromWord = Manager::getAbsoluteURL('public/scripts/dojox/editor/plugins/resources/css/PasteFromWord.css');
     $this->page->addJsCode("dojo.create(\"link\", {href:'{$urlPasteFromWord}', type:'text/css', rel:'stylesheet'}, document.getElementsByTagName('head')[0]);");
     $this->setRender('div');
 }
Example #11
0
 public function render()
 {
     $this->setRender('inputhidden');
     return parent::render();
 }
Example #12
0
 public function onCreate()
 {
     parent::onCreate();
     $this->setMask('#######');
 }
Example #13
0
 public function generateInner()
 {
     $this->type = 'password';
     parent::generateInner();
 }
Example #14
0
 public function onCreate()
 {
     parent::onCreate();
     $this->overrideType = false;
     $this->setRender('inputnumberspinner');
 }
Example #15
0
 public function generateInner()
 {
     $this->value = 'T' . $this->value;
     parent::generateInner();
 }
Example #16
0
 public function generateInner()
 {
     $required = $this->validator instanceof MRequiredValidator;
     $this->setValidator(new MEmailValidator($this->id, 'Informe um email válido.', $required));
     parent::generateInner();
 }
Example #17
0
 public function setName($name)
 {
     $this->name = str_replace(array(':', '[', ']'), '', $name);
     $this->lookupName = "lookup" . ucfirst($this->name);
     parent::setName($this->name);
 }