Lançado Adianti Framework 7.6!
Clique aqui para saber mais
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.     /**
  11.      * Class constructor
  12.      * Creates the page and the registration form
  13.      */
  14.     function __construct()
  15.     {
  16.         parent::__construct();
  17.         
  18.         // creates the form
  19.         $this->form = new TForm('form_ManualExame');
  20.         $this->form->class 'tform'// CSS class
  21.         $this->form->style 'width: 950px';
  22.         
  23.         // add a table inside form
  24.         $table = new TTable;
  25.         $table-> width '100%';
  26.         $this->form->add($table);
  27.         
  28.         // add a row for the form title
  29.         $row $table->addRow();
  30.         $row->class 'tformtitle'// CSS class
  31.         $row->addCell$busca = new TDBEntry('busca''softlab''ManualExame''cod_ajuda'),'right' )->colspan=2;
  32.         
  33.         // create the form fields
  34.         $cod_ajuda    = new TEntry('cod_ajuda');
  35.         $titulo_ajuda = new TEntry('titulo_ajuda');
  36.         $descr_ajuda  = new TText('descr_ajuda');
  37.         
  38.         // define the sizes
  39.         $busca->setSize(940);
  40.         $cod_ajuda->setSize(200);
  41.         $titulo_ajuda->setSize(800);
  42.         $descr_ajuda->setSize(800800);
  43.         
  44.         // add one row for each form field
  45.         $table->addRowSet( new TLabel('MNEMÔNICO: '), $cod_ajuda );
  46.         $table->addRowSet( new TLabel('TÍTULO: '), $titulo_ajuda );
  47.         $table->addRowSet( new TLabel('MANUAL: '), $descr_ajuda );
  48.         
  49.         $this->form->setFields(array($cod_ajuda,$titulo_ajuda,$descr_ajuda));
  50.         parent::add($this->form);
  51.         
  52.     }
  53. }

Pacotão Dominando o Adianti Framework 7
O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado! Versão 7.4


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