Its odd, I changed some of the generateLists prefixing the table on
the field, and ALL generateLists started to order correctly, including
the unchanged ones (without table prefixing). The only unusual thing I
did this time was restart Apache due to an unrelated problem, so Im
guessing it was a caching problem. With DEBUG 3, the SQL querys were
presented without any ORDER BYs before apache restart. After that,
they started to appear correctly:
SELECT `Pretensao`.`id`, `Pretensao`.`descricao` FROM `Pretensoes` AS
`Pretensao` WHERE 1 = 1 ORDER BY `descricao` ASC
without prefixing or
SELECT `Pretensao`.`id`, `Pretensao`.`descricao` FROM `Pretensoes` AS
`Pretensao` WHERE 1 = 1 ORDER BY `Pretensao`.`descricao` ASC
prefixing. Both works as expected.
Thanks Clement!
Norman
On 24 fev, 22:18, clemos <[EMAIL PROTECTED]> wrote:
> probably 'Pretensao.descricao ASC' instead of 'descricao ASC' ?
> don't you have any SQL messages when turning DEBUG to 3 ?
>
> ++++++++
> clement
>
> On 2/24/07, Norman <[EMAIL PROTECTED]> wrote:
>
>
>
> > Is there any black magic on sorting select boxes?
>
> > In the controller, Im trying:
>
> > $this->set('pretensoes', $this->Candidato->Pretensao-
> > >generateList(null,'descricao ASC'));
>
> > The related "pretensoes" table have a "descricao" column. Im using var
> > $displayField = 'descricao' at the pretensoes model. I created the
> > correct inflections for portuguese at inflections.php. However, the
> > generateList result brings the values of the descricao field, but with
> > the primary key field order. Any ideas?
>
> > Thanks in advance,
> > Norman
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---