Lançado Adianti Framework 7.6!
Clique aqui para saber mais
Problema com Notebook criado no Designer Não estou consguindo incluir num TNotebook, criado no Designer, um TMultifield. O que está de errado? ...
RC
Problema com Notebook criado no Designer  
Fechado
Não estou consguindo incluir num TNotebook, criado no Designer, um TMultifield.
O que está de errado?

  1. <?php
  2. /**
  3.  * AlunoForm Registration
  4.  * @author  <your name here>
  5.  */
  6. class AlunoForm extends TPage
  7. {
  8.     private $form;
  9.     private $loaded;
  10.     
  11.     /**
  12.      * Class constructor
  13.      * Creates the page and the registration form
  14.      */
  15.     function __construct()
  16.     {
  17.         parent::__construct();
  18.         
  19.         // creates the form
  20.         $this->form = new TForm('form_Aluno');
  21.         
  22.         try
  23.         {
  24.             // TUIBuilder object
  25.             $ui = new TUIBuilder(500,500);
  26.             $ui->setController($this);
  27.             $ui->setForm($this->form);
  28.             
  29.             // reads the xml form
  30.             $ui->parseFile('app/forms/Aluno.form.xml');  
  31.             // get the interface widgets
  32.             $fields $ui->getWidgets();             
  33.                                           
  34.             
  35.             $multifield = new TMultifield('telefones'); 
  36.             $multifield->setHeight(280); 
  37.             
  38.             
  39.             $ddd    = new TEntry('ddd');
  40.             $numero = new TEntry('numero');
  41.             
  42.             
  43.             $multifield->addField('ddd''DDD'$ddd10);
  44.             $multifield->addField('numero''Numero'$numero40TRUE);
  45.             
  46.             
  47.             
  48.             //$frame_telefone = $ui->getWidget('frame_telefone');
  49.             $frame_telefone $fields['frame_telefone'];
  50.             $frame_telefone->clearChildren();  
  51.             $frame_telefone->add($multifield); 
  52.             
  53.                                   
  54.             // add the TUIBuilder panel inside the TForm object
  55.             $this->form->add($ui);            
  56.             // set form fields from interface fields
  57.             $this->form->setFields($ui->getFields());                                                                                         
  58.         }
  59.         catch (Exception $e)
  60.         {
  61.             new TMessage('error'$e->getMessage());
  62.         }
  63.         
  64.         // add the form to the page
  65.         parent::add($this->form);
  66.     }
  67. }
  68. ?>

Curso completo Meu Negócio Pronto
Use para si, ou transforme em um negócio: Inclui aulas e códigos-fontes
Gestor de conteúdo (SITE) + Loja Virtual (E-Commerce) + Emissor de Notas para infoprodutos


Meu negócio pronto Quero me inscrever agora!

Comentários (2)


RC

Eu até consegui inserir um TEntry, mas quando coloco um TMultifield dá erro.
RC

Amigos,
descobri o erro.
Tinha digitado TMultifield, com o 'f' minúsculo.
O correto seria TMultiField, o pior que nem o AdiantiStudio, na verificação de sintaxe detectou o erro.
Fica aí a sugestão para melhorias, Pablo.