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

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)


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