Como fazer uma busca preencher formulário Senhores, Estou aprendendo Adianti e preciso fazer uma simples tela onde eu faça uma busca através de um TDBEntry e seja retornado no formulário abaixo o registro selecionado. Segue o código: ...
AR
Como fazer uma busca preencher formulário  
Fechado
Senhores,

Estou aprendendo Adianti e preciso fazer uma simples tela onde eu faça uma busca através de um TDBEntry e seja retornado no formulário abaixo o registro selecionado. Segue o código:

 
  1. <?php
  2. /**
  3. * ManualExameForm Registration
  4. * @author <your name here>
  5. */
  6. class ManualExameForm extends TPage
  7. {
  8. protected $form; // form
  9. /**
  10. * Class constructor
  11. * Creates the page and the registration form
  12. */
  13. function __construct()
  14. {
  15. parent::__construct();
  16. // creates the form
  17. $this->form = new TForm('form_ManualExame');
  18. $this->form->class = 'tform'; // CSS class
  19. $this->form->style = 'width: 950px';
  20. // add a table inside form
  21. $table = new TTable;
  22. $table-> width = '100%';
  23. $this->form->add($table);
  24. // add a row for the form title
  25. $row = $table->addRow();
  26. $row->class = 'tformtitle'; // CSS class
  27. $row->addCell( $busca = new TDBEntry('busca', 'softlab', 'ManualExame', 'cod_ajuda'),'right' )->colspan=2;
  28. // create the form fields
  29. $cod_ajuda = new TEntry('cod_ajuda');
  30. $titulo_ajuda = new TEntry('titulo_ajuda');
  31. $descr_ajuda = new TText('descr_ajuda');
  32. // define the sizes
  33. $busca->setSize(940);
  34. $cod_ajuda->setSize(200);
  35. $titulo_ajuda->setSize(800);
  36. $descr_ajuda->setSize(800, 800);
  37. // add one row for each form field
  38. $table->addRowSet( new TLabel('MNEMÔNICO: '), $cod_ajuda );
  39. $table->addRowSet( new TLabel('TÍTULO: '), $titulo_ajuda );
  40. $table->addRowSet( new TLabel('MANUAL: '), $descr_ajuda );
  41. $this->form->setFields(array($cod_ajuda,$titulo_ajuda,$descr_ajuda));
  42. parent::add($this->form);
  43. }
  44. }

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)


AR

Alguém dá uma ideia de como posso fazer e principalmente porque o campo TDBEntry não está funcionando.
FC

Alisson

A busca deve ser feita em um lista e não num form. se usa o studio pro crie uma nova lista pelo passo a passo e selecione o TDBEntry.

Exemplo completo

www.adianti.com.br/framework_files/tutor/index.php?class=CustomerDat