Check the manual:
http://manual.cakephp.org/chapter/models
Need to do something like this:
$this->Role->generateList(null, 'role_name ASC', null, '{n}.Role.id',
'{n}.Role.role_name')
generateList is automatic only if you have fields named "title/name" (I
believe). If not, you need to specifically tell it which to display.
--
Baz L
Web Development 2.0
http://WebDevelopment2.com/
On Dec 19, 2007 1:13 PM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:
>
> Thank you for answering.
>
> In which file would we have to do this?
>
> I have the same problem, in one add.ctp view i have the following
> drop downs:
>
> echo $form->input('producttype_id');
> echo $form->input('destination_id');
> echo $form->input('contract_id');
>
> The destination_id gives me the real name in the list, the other two
> ones just give me the id's.
> I figured out that this is because destination has a field called
> "name" - so cake nows this is the description field.
>
> But how do i set this for the producttype and contract? The field
> names with the descriptions are description in these tables.
>
> Thank you
>
> On Dec 19, 11:29 am, RichardAtHome <[EMAIL PROTECTED]> wrote:
> > Do you mean generateList()?
> >
> > if so:
> >
> > $this->set("contacts", $this->Contact->generateList());
> >
> > if you want to generated an ordered list:
> >
> > $this->set("contacts", $this->Contact->generateList(null, "name"));
> >
> > (will order the list by the name field)
> >
> > Hope this helps.
> >
> > On Dec 18, 6:04 pm, Brian <[EMAIL PROTECTED]> wrote:
> >
> > > Can someone point me to a clear example of tutorial on how to build a
> > > drop down box from the getList method.
> > > I searched the post and didn't find anything useful.
> > > Thanks in advance. Brian
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---