I'm having trouble creating combobox components.
The cakephp is generating empty options to "select" the component.
<option value="1"></option>
<option value="2"></option>
<option value="3">Visita</option>
<option value="4">Proposta</option>
<option value="5"></option>
<option value="6"></option>
In the Controller
$situacaoVendas = $this->SituacaoVenda->find('list');
In the View
echo $this->Form->input('situacao_venda_id');
The html output was
<select name="data[PessoasIteracao][situacao_venda_id]" id="PessoasIteracaoSituacaoVendaId">
<option value="1"></option>
<option value="2"></option>
<option value="3">Visita</option>
<option value="4">Proposta</option>
<option value="5"></option>
<option value="6"></option>
</select>
The query execute by cakephp was
SELECT `SituacaoVenda`.`id`, `SituacaoVenda`.`nome` FROM `crm`.`situacao_vendas` AS `SituacaoVenda` WHERE 1 = 1
the result sql was
id nome
-------------------
1 Telefone
2 Email
3 Agendamento
4 Visita
5 Anotação
The Model Class
<?php
App::uses('AppModel', 'Model');
/**
* SituacaoVenda Model
*
*/
class SituacaoVenda extends AppModel {
/**
* Display field
*
* @var string
*/
public $displayField = 'nome';
}
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment