Consegui da seguinte forma: $this->set('sectionsList', $this->Ponto->Section->generateList(NULL, "nome ASC", NULL, "{n}.Section.id", "{n}.Section.nome")); if(empty($this->data['Section'])) { $this->data['Section'] = null; } $this->set('selectedSections', $this->_selectedArray($this->data['Section']));
<?php echo $html->selectTag('Section/Section', $sectionsList, $selectedSections, array('multiple' => 'multiple', 'class' => 'selectMultiple'), array(), true);?> Geovane. On 10/27/07, Geovane Silva <[EMAIL PROTECTED]> wrote: > > Tentei da seguinte forma: > > $this->set('selected', $this->Section->query("SELECT section_id FROM > pontos_sections WHERE ponto_id = $id")) > > $html->selectTag('Section/Section', $sectionsList, $selected, > array('multiple'=>'multiple')) > > Sendo que $selected é um array e no selectag não funciona como array e > quero que fique selecionado varios itens por se tratar em NxN. > > Uma luz por favor! > > Geovane. > > On 10/26/07, Geovane Silva <[EMAIL PROTECTED]> wrote: > > > > Pessoal, > > > > fiz um relacionamento hasAndBelongsToMany e funcionou perfeitamente! > > > > Agora como faço para que no selectTag (multiple) mostre os itens > > marcados na edição? > > > > -- > > Geovane Lopes da Silva > > > -- Geovane Lopes da Silva MSN: [EMAIL PROTECTED] Consultor E-Government - Governo AM Fone: (92) 2121-1730 Ramal 222 Celular: (92) 9117-3879 --~--~---------~--~----~------------~-------~--~----~ Recebeu esta mensagem porque está inscrito em Grupo "Cake PHP Português" do Grupos Google. Para enviar mensagens para este grupo, envie um email para cake-php-pt@googlegroups.com Para anular a inscrição neste grupo, envie um email para [EMAIL PROTECTED] Para mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-PT -~----------~----~----~----~------~----~------~--~---