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. * Class constructor
  12. * Creates the page and the registration form
  13. */
  14. function __construct()
  15. {
  16. parent::__construct();
  17. // creates the form
  18. $this->form = new TForm('form_Aluno');
  19. try
  20. {
  21. // TUIBuilder object
  22. $ui = new TUIBuilder(500,500);
  23. $ui->setController($this);
  24. $ui->setForm($this->form);
  25. // reads the xml form
  26. $ui->parseFile('app/forms/Aluno.form.xml');
  27. // get the interface widgets
  28. $fields = $ui->getWidgets();
  29. $multifield = new TMultifield('telefones');
  30. $multifield->setHeight(280);
  31. $ddd = new TEntry('ddd');
  32. $numero = new TEntry('numero');
  33. $multifield->addField('ddd', 'DDD', $ddd, 10);
  34. $multifield->addField('numero', 'Numero', $numero, 40, TRUE);
  35. //$frame_telefone = $ui->getWidget('frame_telefone');
  36. $frame_telefone = $fields['frame_telefone'];
  37. $frame_telefone->clearChildren();
  38. $frame_telefone->add($multifield);
  39. // add the TUIBuilder panel inside the TForm object
  40. $this->form->add($ui);
  41. // set form fields from interface fields
  42. $this->form->setFields($ui->getFields());
  43. }
  44. catch (Exception $e)
  45. {
  46. new TMessage('error', $e->getMessage());
  47. }
  48. // add the form to the page
  49. parent::add($this->form);
  50. }
  51. }
  52. ?>

Curso Dominando o Adianti Framework

O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado!


Dominando o Adianti Framework 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.