Lançado Adianti Framework 7.6!
Clique aqui para saber mais
Formulário responsivo Senhores, estou com o seguinte problema, Ao criar um formulário utilizando a bootstrap builder, ao redimencionar o formulário o mesmo fica desconfigurado, segue código abaixo se alguém puder me ajudar agradeço. ...
RB
Formulário responsivo  
Senhores, estou com o seguinte problema,

Ao criar um formulário utilizando a bootstrap builder, ao redimencionar o formulário o mesmo fica desconfigurado, segue código abaixo se alguém puder me ajudar agradeço.

  1. <?php
  2. class ClienteFisicoBuilder extends TPage
  3. {
  4.    private $form;
  5.  
  6.     public function __construct()
  7.     {
  8.         parent::__construct();
  9.         
  10.         $this->form = new BootstrapFormBuilder('frm_cliente_fisico');
  11.         $this->form->setFormTitle('Cliente');
  12.         $this->form->class 'form-inline';
  13.                         
  14.         $dados_cliente = new TLabel('Dados Pessoais''#425a74'12'b');
  15.         $dados_cliente->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%;float:left;margin-top:-20px;';
  16.         $this->form->addContent( [$dados_cliente] );
  17.         
  18.         // add a row with 2 slots
  19.         $label_nome = new TLabel('Nome','#425a74');
  20.         $label_nome->style='text-align:left;float:left;width:100%;display:inline-block;';
  21.         
  22.         $lbl_data_nascto = new TLabel('Data Nascimento','#425a74');
  23.         $lbl_data_nascto->style='text-align:left;float:left;width:100%;';
  24.         
  25.         $lbl_estado_civil = new TLabel('Estado Cívil','#425a74');
  26.         $lbl_estado_civil->style='text-align:left;float:left;width:100%;';
  27.                 
  28.         $nome = new TEntry('nome');
  29.         $nome->style='text-align:left;float:left;width:100%';
  30.         
  31.         $data_nascto = new TDate('data_nascto');
  32.         $data_nascto->style='text-align:left;float:left;width:100%';
  33.         $data_nascto->setMask('dd/mm/yyyy'); // define date mask
  34.         
  35.         $estado_civil = new TEntry('estado_civil');
  36.         $estado_civil= new TDBCombo('EstadoCivil','sgvo''Civil''id''descricao');
  37.         
  38.         $lbl_genero = new TLabel('Genero','#425a74');
  39.         $lbl_genero->style ='text-align:left;float:left;width:100%';
  40.         
  41.         $genero = new TCombo('genero');
  42.         $genero->addItems( ['1' => 'Masculino''2' => 'Feminino'] );
  43.                 
  44.         $lbl_cpf = new TLabel('CPF','#425a74');
  45.         $cpf = new TEntry('cpf');
  46.         //$cpf->setMask('000.000.000.00');
  47.         $cpf->addValidation('CPF', new TCPFValidator, new TMaxValueValidator,array(14));
  48.         //$cpf->setDatabaseMask('00000000000');
  49.         $lbl_cpf->style='text-align:left;float:left;width:100%';
  50.         
  51.         $lbl_rg = new TLabel('RG','#425a74');
  52.         $rg = new TEntry('rg');
  53.         $rg->setMask('00.000.000.00');
  54.         $rg->setMaxLength(12);
  55.         $lbl_rg->style='text-align:left;float:left;width:100%';
  56.         
  57.         $lbl_etnia = new TLabel('Etnia','#425a74');
  58.         $etnia = new TDBCombo('Etnia','sgvo','Etnia','id','descricao');
  59.         //$etnia = new TEntry('etnia');
  60.                 
  61.         $this->form->addFields( [$label_nome,$lbl_data_nascto,$lbl_estado_civil] );
  62.         $this->form->addFields( [$nome,$data_nascto,$estado_civil] );
  63.         $this->form->addFields( [$lbl_genero,$lbl_cpf,$lbl_rg,$lbl_etnia] );
  64.         $this->form->addFields( [$genero,$cpf,$rg,$etnia] );
  65.         
  66.         $label_nome->setSize('40%');
  67.         $nome->setSize('40%');
  68.         
  69.         $lbl_data_nascto->setSize('20%');
  70.         $data_nascto->setSize('20%');
  71.         
  72.         $lbl_estado_civil->setSize('20%');
  73.         $estado_civil->setSize('20%');
  74.         
  75.         $lbl_genero->setSize('20%');
  76.         $genero->setSize('20%');
  77.         
  78.         $lbl_cpf->setSize('20%');
  79.         $cpf->setSize('20%');
  80.         
  81.         $lbl_rg->setSize('20%');
  82.         $rg->setSize('20%');
  83.         
  84.         $lbl_etnia->setSize('20%');
  85.         $etnia->setSize('20%');
  86.         
  87.         //dados de contato
  88.         $contato = new TLabel('Contato''#425a74'12'b');
  89.         $contato->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%';
  90.         
  91.         $lbl_ddi = new TLabel('DDI','#425a74');
  92.         $lbl_ddi->style='text-align:left;';
  93.         $ddi = new TEntry('ddi[]');
  94.         
  95.         $lbl_dd = new TLabel('DDD','#425a74');
  96.         $lbl_dd->style='text-align:left;';
  97.         $dd = new TEntry('dd[]');
  98.         
  99.         $lbl_tipo_telefone = new TLabel('Tipo Telefone','#425a74');
  100.         $lbl_tipo_telefone->style='text-align:left;';
  101.         $tipo_telefone = new TDBCombo('TipoTelefone','sgvo','TipoTelefone','id','descricao');
  102.         
  103.         $lbl_telefone = new TLabel('Telefone','#425a74');
  104.         $lbl_telefone->style='text-align:left;width:100';
  105.         $telefone = new TEntry('telefone');
  106.         $telefone->setMask('9999-9999');
  107.                         
  108.         $lbl_operadora = new TLabel('Operadora','#425a74');
  109.         $lbl_operadora->style='text-align:left;';
  110.         $operadora = new TDBCombo('Operadora','sgvo','Operadora','id','nome');
  111.         
  112.         $lbl_email = new TLabel('Email','#425a74');
  113.         $lbl_email->style='text-align:left;';
  114.         $email = new TEntry('email');
  115.         //$email->addValidation('email', new TEmailValidator); // email field
  116.         
  117.         $lbl_site = new TLabel('Site','#425a74');
  118.         $lbl_site->style='text-align:left;';
  119.         $site = new TEntry('site');
  120.         $this->form->addContent( [$contato] );
  121.         
  122.         //adiciona campos para contato / telefone
  123.         $table = new TTable;
  124.         $table->style='border 1px solid #333;';
  125.         $table->width='100%';
  126.         $table->addSection('thead');
  127.         $table->addRowSet([$lbl_ddi,$lbl_dd,$lbl_tipo_telefone,$lbl_telefone,$lbl_operadora]);       
  128.         $table->addSection('tbody');
  129.         
  130.         for ($n=0$n<=0$n++)
  131.         {
  132.             // create delete button
  133.             $del = new TImage('fa:trash-o blue');
  134.             $del->onclick 'ttable_remove_row(this)';
  135.             
  136.             // create add button
  137.             $add = new TButton('clone');
  138.             $add->setLabel('Adicionar');
  139.             $add->setImage('fa:plus-circle green');
  140.             $table->addRowSet( [$ddi,$dd,$tipo_telefone,$telefone,$operadora$del]);
  141.             
  142.         }
  143.         $add->addFunction('ttable_clone_previous_row(this)');
  144.         $table->addRowSet($add);
  145.         $this->form->addFields( [$table]);
  146.         
  147.         $this->form->addFields( [ $lbl_email,$lbl_site] );
  148.         $this->form->addFields( [ $email,$site] );
  149.         
  150.         $lbl_ddi->setSize('40');
  151.         $ddi->setSize('40');
  152.         $lbl_dd->setSize('40');
  153.         $dd->setSize('40');
  154.         
  155.         $lbl_tipo_telefone->setSize('100');
  156.         $tipo_telefone->setSize('100');
  157.         $lbl_telefone->setSize('100');
  158.         $telefone->setSize('100');
  159.         
  160.         $lbl_email->setSize('40%');
  161.         $lbl_site->setSize('40%');
  162.         
  163.         $email->setSize('40%');
  164.         $site->setSize('40%');
  165.         
  166.         //dados de correspondência
  167.         $lbl_endereco = new TLabel('Endereco''#425a74'12'b');
  168.         $lbl_endereco->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%';
  169.         
  170.         $lbl_cep = new TLabel('Cep''#425a74'12);
  171.         $lbl_cep->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%';
  172.         $cep = new TEntry('cep');
  173.                 
  174.         $lbl_logradouro = new TLabel('Logradouro''#425a74'12);
  175.         $lbl_logradouro->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%';
  176.         $logradouro = new TEntry('logradouro');
  177.         $logradouro->style='float:left;';
  178.         
  179.         $lbl_numero = new TLabel('Número''#425a74'12);
  180.         $lbl_numero->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%';
  181.         $numero = new TEntry('numero');
  182.         
  183.         $lbl_bairro = new TLabel('Bairro''#425a74'12);
  184.         $lbl_bairro->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%';
  185.         $bairro = new TEntry('bairro');
  186.         
  187.         $lbl_cidade = new TLabel('Cidade''#425a74'12);
  188.         $lbl_cidade->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%';
  189.         $cidade = new TEntry('cidade');
  190.         
  191.         $lbl_uf = new TLabel('Estado''#425a74'12);
  192.         $lbl_uf->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%';
  193.         $uf = new TEntry('uf');
  194.         
  195.         $lbl_complemento = new TLabel('Complemento''#425a74'12);
  196.         $lbl_complemento->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%';
  197.         $complemento = new TEntry('complemento');
  198.         
  199.         $lbl_cep->setSize('20%');
  200.         $cep->setSize('100');
  201.         
  202.         $lbl_logradouro->setSize('40%');        
  203.         $logradouro->setSize('40%');
  204.         
  205.         $lbl_numero->setSize('20%');
  206.         $numero->setSize('20%');
  207.         
  208.         $lbl_bairro->setSize('20%');
  209.         $lbl_cidade->setSize('32%');
  210.         $lbl_uf->setSize('8%');
  211.         
  212.         $bairro->setSize('20%');
  213.         $cidade->setSize('32%');
  214.         $uf->setSize('8%');
  215.         
  216.         $btn_cep = new TButton('btn_cep');
  217.         $btn_cep->setSize(100);
  218.         $btn_cep->style='float:left;padding-rigth:10px;color:#425a74';
  219.         $btn_cep->setAction(new TAction(array($this,'onCep')),'Busca Cep');
  220.         
  221.         $btn_cep->setImage('fa:search blue');
  222.         
  223.         $this->form->addFields( [$lbl_endereco] );
  224.         $this->form->addFields( [$lbl_cep,$lbl_logradouro,$lbl_numero] );
  225.         $this->form->addFields( [$cep,$btn_cep,$logradouro,$numero] );
  226.         $this->form->addFields( [$lbl_bairro,$lbl_cidade,$lbl_uf,$lbl_complemento] );
  227.         $this->form->addFields( [$bairro,$cidade,$uf,$complemento] );
  228.                 
  229.         $this->form->addAction('Salvar', new TAction(array($this'onSave')), 'ico_save.png');
  230.         
  231.         // wrap the page content using vertical box
  232.         $vbox = new TVBox;
  233.         $vbox->add(new TXMLBreadCrumb('menu.xml'__CLASS__));
  234.         $vbox->add($this->form);
  235.         parent::add($this->form);
  236.     }
  237.     
  238.     /**
  239.      * Post data
  240.      */
  241.    function onSave(){
  242.             $this->organizacao_id TSession::getValue('organizacion_id'); // pega id da empresa
  243.             $atualizacao date('Y-m-d H:m:s');
  244.          try{
  245.             TTransaction::open('u239729888_sgv');// open a transaction with database 'sgvo'
  246.            
  247.            /* TTransaction::setLoggerFunction(function($message){
  248.                                                             print $message.'<br/>';
  249.                                                         });
  250.             */
  251.             $data $this->form->getData(); // get the form data into an active record Pessoa
  252.             $pessoa = new Pessoa;
  253.             $pessoa->fromArray((array) $data);
  254.             $this->form->validate();// form validation
  255.             $pessoa->nome            $data->nome;
  256.             $object->data_nascimento TDate::date2us($data->data_nascto) ;  //---> Tranforma Data no padrão americano
  257.             $pessoa->organizacao_id  $this->organizacao_id;
  258.             $pessoa->atualizacao     $atualizacao;
  259.             $pessoa->tipo_pessoa_id  1;
  260.             //$pessoa->addContato($contato); //rever este trecho
  261.             
  262.             // stores the object
  263.             $pessoa->store();
  264.             $id $pessoa->id// valor retornado após a persistência do objeto.
  265.         
  266.         $data $this->form->getData();
  267.         $this->form->setData($data);
  268.         
  269.         echo '<pre>';
  270.         print_r($data);
  271.         echo '</pre>';
  272.         
  273.         }
  274.         catch (Exception $e// in case of exception
  275.         {
  276.             new TMessage('error'$e->getMessage());
  277.             $this->form->setData$this->form->getData() ); // keep form data
  278.              TTransaction::rollback();
  279.         }
  280.     }
  281.     
  282.     /**
  283.      * method onCep()
  284.      * Executed whenever the user clicks at the edit button da datagrid
  285.      */
  286.      public function onCep($param){
  287.         $retorno Endereco::BuscaCep($param['cep']);
  288.         if ( $retorno )
  289.         {
  290.             $data $this->form->getData();
  291.             $data->ibge       strtoupper$retorno['ibge']);
  292.             $data->gia        strtoupper$retorno['gia']);
  293.             $data->logradouro strtoupper$retorno['logradouro']);
  294.             $data->bairro     strtoupper$retorno['bairro']);
  295.             $data->cidade     strtoupper$retorno['localidade']);
  296.             $data->uf         strtoupper$retorno['uf']);
  297.             $this->form->setData($data);
  298.         }
  299.         else {
  300.             new TMessage("error""CEP - Em Branco ou Inválido");
  301.         }
  302.     }
  303. }
  304. ?>

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)


NR

Você não passou tamanho para o campo complemento, desse modo automaticamente ele fica com 200px. Defina o tamanho em % para todos os campos.
RB

Então já fiz isto porém não deu certo.

Veja
  1. <?php
  2. class ClienteFisicoBuilder extends TPage
  3. {
  4.    private $form;
  5.  
  6.     public function __construct()
  7.     {
  8.         parent::__construct();
  9.         
  10.         $this->form = new BootstrapFormBuilder('frm_cliente_fisico');
  11.         $this->form->setFormTitle('Cliente');
  12.         $this->form->style='font-family:Arial Narrow;';
  13.                         
  14.         $dados_cliente = new TLabel('Dados Pessoais''#1F4E78'12'b');
  15.         $dados_cliente->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%;float:left;margin-top:-20px;font-family:Arial Narrow;';
  16.         $this->form->addContent( [$dados_cliente] );
  17.         
  18.         // add a row with 2 slots
  19.         //$label_id = new TLabel('Id','#1F4E78');
  20.        // $label_id->style='text-align:left;float:left;';
  21.         
  22.         //div container para ajustar os label e campos
  23.         $div_nome = new TElement("span");
  24.         $div_nome->style="background-color=red;width:240px;";
  25.         
  26.         $label_nome = new TLabel('Nome','#1F4E78');
  27.         $label_nome->style='text-align:left;float:left;font-family:Arial Narrow;';
  28.         
  29.         
  30.         
  31.         $lbl_data_nascto = new TLabel('Data Nascimento','#1F4E78');
  32.         $lbl_data_nascto->style='text-align:left;float:left;font-family:Arial Narrow;';
  33.         
  34.         $lbl_estado_civil = new TLabel('Estado Cívil','#1F4E78');
  35.         $lbl_estado_civil->style='text-align:left;float:left;font-family:Arial Narrow;';
  36.         
  37.        // $id = new TEntry('id');
  38.        // $id->style='text-align:left;float:left;';
  39.                 
  40.         $nome = new TEntry('nome');
  41.         $nome->style='text-align:left;float:left;';
  42.         $nome->addValidation('Data Nascimento', new TRequiredValidator);
  43.         
  44.         $data_nascimento = new TDate('data_nascimento');
  45.         $data_nascimento->addValidation('Data Nascimento', new TRequiredValidator);
  46.         $data_nascimento->style='text-align:left;float:left;';
  47.         $data_nascimento->setMask('dd/mm/yyyy'); // define date mask
  48.         //$data_nascimento->setDatabaseMask('yyyy-mm-dd');
  49.         
  50.         $estado_civil= new TDBCombo('estado_civil_id','sgvo''Civil''id''descricao');
  51.         
  52.         $lbl_genero = new TLabel('Genero','#1F4E78');
  53.         $lbl_genero->style ='text-align:left;float:left;width:100%;font-family:Arial Narrow;';
  54.         
  55.         $genero_id = new TCombo('genero_id');
  56.         $genero_id->addItems( ['1' => 'Masculino''2' => 'Feminino'] );
  57.                 
  58.         $lbl_cpf = new TLabel('CPF','#1F4E78');
  59.         $cpf = new TEntry('cpf');
  60.         $cpf->setMask('000.000.000.00');
  61.         $cpf->addValidation('CPF', new TCPFValidator, new TMaxValueValidator,array(14));
  62.         //$cpf->setDatabaseMask('00000000000');
  63.         $lbl_cpf->style='text-align:left;float:left;font-family:Arial Narrow;';
  64.         
  65.         $lbl_rg = new TLabel('RG','#1F4E78');
  66.         $rg = new TEntry('rg');
  67.         $rg->setMask('00.000.000.00');
  68.         $rg->setMaxLength(12);
  69.         $lbl_rg->style='text-align:left;float:left;font-family:Arial Narrow;';
  70.         
  71.         /*
  72.         $lbl_cnh = new TLabel('CNH','#1F4E78');
  73.         $cnh = new TEntry('cnh');
  74.         $cnh->setMask('00.000.000.00');
  75.         $cnh->setMaxLength(12);
  76.         $lbl_cnh->style='text-align:left;float:left;';
  77.         */
  78.         
  79.         
  80.         $lbl_etnia = new TLabel('Etnia','#1F4E78');
  81.         $etnia_id = new TDBCombo('etnia_id','sgvo','Etnia','id','descricao');
  82.                 
  83.        // $this->form->addFields( [$label_id,$id] );        
  84.         $this->form->addFields( [$label_nome,$lbl_data_nascto,$lbl_estado_civil] );
  85.         $this->form->addFields( [$nome,$data_nascimento,$estado_civil] );
  86.         $this->form->addFields( [$lbl_genero,$lbl_etnia,$lbl_cpf,$lbl_rg] );
  87.         $this->form->addFields( [$genero_id,$etnia_id,$cpf,$rg] );
  88.         
  89.         //dados de contato
  90.         $contato = new TLabel('Contato''#1F4E78'12'b');
  91.         $contato->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%;font-family:Arial Narrow;';
  92.         
  93.         $lbl_ddi = new TLabel('DDI','#1F4E78');
  94.         $lbl_ddi->style='text-align:left;font-family:Arial Narrow;';
  95.         $ddi = new TEntry('ddi[]');
  96.         
  97.         $lbl_dd = new TLabel('DDD','#1F4E78');
  98.         $lbl_dd->style='text-align:left;font-family:Arial Narrow;';
  99.         $dd = new TEntry('dd[]');
  100.         
  101.         $lbl_tipo_telefone = new TLabel('Tipo Telefone','#1F4E78');
  102.         $lbl_tipo_telefone->style='text-align:left;font-family:Arial Narrow;';
  103.         $tipo_telefone = new TDBCombo('TipoTelefone','sgvo','TipoTelefone','id','descricao');
  104.         
  105.         $lbl_telefone = new TLabel('Telefone','#1F4E78');
  106.         $lbl_telefone->style='text-align:left;font-family:Arial Narrow;';
  107.         $telefone = new TEntry('telefone');
  108.         $telefone->setMask('9999-9999');
  109.                         
  110.         $lbl_operadora = new TLabel('Operadora','#1F4E78');
  111.         $lbl_operadora->style='text-align:left;font-family:Arial Narrow;';
  112.         $operadora = new TDBCombo('Operadora','sgvo','Operadora','id','nome');
  113.         
  114.         $lbl_email = new TLabel('Email','#1F4E78');
  115.         $lbl_email->style='text-align:left;;font-family:Arial Narrow;';
  116.         $email = new TEntry('email');
  117.         //$email->addValidation('email', new TEmailValidator); // email field
  118.         
  119.         $lbl_site = new TLabel('Site','#1F4E78');
  120.         $lbl_site->style='text-align:left;font-family:Arial Narrow;';
  121.         $site = new TEntry('site');
  122.         $this->form->addContent( [$contato] );
  123.         
  124.         //adiciona campos para contato / telefone
  125.         $table = new TTable;
  126.         $table->style='border 1px solid #333;font-family:Arial Narrow;';
  127.         $table->width='100%';
  128.         $table->addSection('thead');
  129.         $table->addRowSet([$lbl_ddi,$lbl_dd,$lbl_tipo_telefone,$lbl_telefone,$lbl_operadora]);       
  130.         $table->addSection('tbody');
  131.         
  132.         for ($n=0$n<=0$n++)
  133.         {
  134.             // create delete button
  135.             $del = new TImage('fa:trash-o blue');
  136.             $del->onclick 'ttable_remove_row(this)';
  137.             
  138.             // create add button
  139.             $add = new TButton('clone');
  140.             $add->setLabel('Adicionar');
  141.             $add->setImage('fa:plus-circle green');
  142.             $table->addRowSet( [$ddi,$dd,$tipo_telefone,$telefone,$operadora$del]);
  143.             
  144.         }
  145.         $add->addFunction('ttable_clone_previous_row(this)');
  146.         $table->addRowSet($add);
  147.         $this->form->addFields( [$table]);
  148.         
  149.         $this->form->addFields( [ $lbl_email,$lbl_site] );
  150.         $this->form->addFields( [ $email,$site] );
  151.         
  152.         //dados de correspondência
  153.         $lbl_endereco = new TLabel('Endereco''#1F4E78'12'b');
  154.         $lbl_endereco->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%;font-family:Arial Narrow;';
  155.         
  156.         $lbl_cep = new TLabel('Cep''#1F4E78'12);
  157.         $lbl_cep->style='text-align:left;border-bottom:1px solid #c0c0c0;font-family:Arial Narrow;';
  158.         $cep = new TEntry('cep');
  159.         $cep->addValidation('CEP', new TRequiredValidator, new TMaxValueValidator,array(8));
  160.                 
  161.         $lbl_logradouro = new TLabel('Logradouro''#1F4E78'12);
  162.         $lbl_logradouro->style='text-align:left;border-bottom:1px solid #c0c0c0;font-family:Arial Narrow;';
  163.         $logradouro = new TEntry('logradouro');
  164.         $logradouro->style='float:left;';
  165.         $logradouro->addValidation('Logradouro', new TRequiredValidator);
  166.         
  167.         $lbl_numero = new TLabel('Número''#1F4E78'12);
  168.         $lbl_numero->style='text-align:left;border-bottom:1px solid #c0c0c0;font-family:Arial Narrow;';
  169.         $numero = new TEntry('numero');
  170.         $numero->addValidation('Número', new TRequiredValidator);
  171.         
  172.         $lbl_bairro = new TLabel('Bairro''#1F4E78'12);
  173.         $lbl_bairro->style='text-align:left;border-bottom:1px solid #c0c0c0;font-family:Arial Narrow;';
  174.         $bairro = new TEntry('bairro');
  175.         $bairro->addValidation('Bairro', new TRequiredValidator);
  176.         
  177.         $lbl_cidade = new TLabel('Cidade''#1F4E78'12);
  178.         $lbl_cidade->style='text-align:left;border-bottom:1px solid #c0c0c0;width:100%;font-family:Arial Narrow;';
  179.         $cidade = new TEntry('cidade');
  180.         $cidade->addValidation('Cidade', new TRequiredValidator);
  181.         
  182.         $lbl_uf = new TLabel('Estado''#1F4E78'12);
  183.         $lbl_uf->style='text-align:left;border-bottom:1px solid #c0c0c0;font-family:Arial Narrow;';
  184.         $uf = new TEntry('uf');
  185.         $uf->addValidation('Estado', new TRequiredValidator);
  186.         
  187.         $lbl_complemento = new TLabel('Complemento''#1F4E78'12);
  188.         $lbl_complemento->style='text-align:left;border-bottom:1px solid #c0c0c0;font-family:Arial Narrow;';
  189.         $complemento = new TEntry('complemento');
  190.         
  191.         $label_nome->setSize('40%');
  192.         $nome->setSize('40%');
  193.         $lbl_data_nascto->setSize('20%');
  194.         $data_nascimento->setSize('20%');
  195.         $lbl_estado_civil->setSize('20%');
  196.         $estado_civil->setSize('20%');
  197.         $lbl_genero->setSize('20%');
  198.         $genero_id->setSize('20%');
  199.         $lbl_cpf->setSize('20%');
  200.         $cpf->setSize('20%');
  201.         $lbl_rg->setSize('20%');
  202.         $rg->setSize('20%');
  203.         //$lbl_cnh->setSize('19%');
  204.         //$cnh->setSize('19%');
  205.         
  206.         $lbl_etnia->setSize('20%');
  207.         $etnia_id->setSize('20%');
  208.         $lbl_ddi->setSize('40');
  209.         $ddi->setSize('40');
  210.         $lbl_dd->setSize('40');
  211.         $dd->setSize('40');
  212.         $lbl_tipo_telefone->setSize('100');
  213.         $tipo_telefone->setSize('100');
  214.         $lbl_telefone->setSize('100');
  215.         $telefone->setSize('100');
  216.         $lbl_email->setSize('40%');
  217.         $lbl_site->setSize('40%');
  218.         $email->setSize('40%');
  219.         $site->setSize('40%');
  220.         $lbl_cep->setSize('20%');
  221.         $cep->setSize('100');
  222.         $lbl_logradouro->setSize('40%');        
  223.         $logradouro->setSize('40%');
  224.         $lbl_numero->setSize('20%');
  225.         $numero->setSize('20%');
  226.         $lbl_bairro->setSize('20%');
  227.         $lbl_cidade->setSize('32%');
  228.         $lbl_uf->setSize('8%');
  229.         $bairro->setSize('20%');
  230.         $cidade->setSize('32%');
  231.         $uf->setSize('8%');
  232.         
  233.         $btn_cep = new TButton('btn_cep');
  234.         $btn_cep->setSize(100);
  235.         $btn_cep->style='float:left;padding-rigth:10px;color:#1F4E78';
  236.         $btn_cep->setAction(new TAction(array($this,'onCep')),'Busca Cep');
  237.         
  238.         $btn_cep->setImage('fa:search blue');
  239.         
  240.         $this->form->addFields( [$lbl_endereco] );
  241.         $this->form->addFields( [$lbl_cep,$lbl_logradouro,$lbl_numero] );
  242.         $this->form->addFields( [$cep,$btn_cep,$logradouro,$numero] );
  243.         $this->form->addFields( [$lbl_bairro,$lbl_cidade,$lbl_uf,$lbl_complemento] );
  244.         $this->form->addFields( [$bairro,$cidade,$uf,$complemento] );
  245.                 
  246.         $this->form->addAction('Salvar', new TAction(array($this'onSave')), 'ico_save.png');
  247.         
  248.         // wrap the page content using vertical box
  249.         $vbox = new TVBox;
  250.         $vbox->add(new TXMLBreadCrumb('menu.xml'__CLASS__));
  251.         $vbox->add($this->form);
  252.         parent::add($this->form);
  253.     }
  254. ?>