I understand that they're not supposed to do the same thing. However,
I can assure you that a $form->select('group_id') does not get
populated. Not sure what the issue is.
I discovered this while trying to used a select list without a label.
I was forced to use: $form->input('group_id', array('type' =>
'select', 'label' => false));
Granted, I haven't debugged through the code:
This is what I've done:
Bake a basic set controllers and views from User with a belongsTo on Group.
On the add/edit I simply change $form->input('group_id') to
$form->select('groupd_id').
The select list is empty.
All I know is that it if I change $form->input('group_id') to
$form->text('group_id') it is populated, however select has an empty
drop down list. Not really sure what else to tell you.
I'm not sure what the expected behavior is, but what I expect (based
on other form furctions) doesn't seem to be happening. If my
expectation is unreasonable then there should be some mention in the
book.cakephp.org with specific reference to why this shouldn't work
with select boxes.
Again, I'm using 6311 beta.
Already filed an enhancement ticket:
https://trac.cakephp.org/ticket/4270
On Tue, Mar 4, 2008 at 1:19 PM, nate <[EMAIL PROTECTED]> wrote:
>
> $form->select (and therefore $form->input("...", array("type" =>
> "select)); by extension) *are* populated from $this->data, just like
> everything else (i.e. all other form field types). The only thing
> different about a select input field is the need to generate available
> options. That's where you're getting confused: the $options parameter
> in FormHelper::select() has no parallel in any other form field.
> Since $form->select() is a base method and not a wrapper method, it
> does not utilize any more magic than necessary.
>
>
> On Mar 4, 1:17 pm, Baz <[EMAIL PROTECTED]> wrote:
> > I don't think I'm talking bout POST data. I'm taking about, through
> > setting a variable via $this->MyModel->find('list').
> >
> > All the other fields get set directly through $this->data. However,
> > I'm talking specifically about:
> >
> > $this->select('group_id')
> >
> > as compared to:
> > $this->input('group_id', array('type' => 'select')) does.
> >
>
> > On Tue, Mar 4, 2008 at 9:03 AM, nate <[EMAIL PROTECTED]> wrote:
> >
> > > $form->select() *does* auto-populate... from POST data. Just like
> > > everything else. So no, this is not a bug. The non-wrapper methods
> > > keep the magic to a necessary minimum.
> >
> > > On Mar 4, 1:56 am, Baz <[EMAIL PROTECTED]> wrote:
> > > > Well, that's my question:
> >
> > > > Is this is bug (oversight)? $form->text, $form->checkbox both
> > > > autofill, so should I report this?
> >
> > > > On Tue, Mar 4, 2008 at 12:34 AM, Samuel DeVore <[EMAIL PROTECTED]>
> wrote:
> >
> > > > > On Mon, Mar 3, 2008 at 11:24 PM, Baz <[EMAIL PROTECTED]> wrote:
> >
> > > > > > I take it you meant:
> > > > > > $form->select('groups')?
> >
> > > > > $groups = $this->MyModel->find('list')
> > > > > $this->set(compact('groups'));
> >
> > > > > Is what I was thinking, but I don't think FormHelper::select
> supports
> > > > > the auto finding of the options array like input does, if you look
> at
> > > > > the code from the api
> >
> > > > > http://api.cakephp.org/1.2/form_8php-source.html#l00491around line
>
> > > > > 535 you'll see where that is autofilled from
> >
> > > > > in FormHelper::select
> > > > > http://api.cakephp.org/1.2/form_8php-source.html#l01002you can see
>
>
> > > > > that there is no similar feature. So if you want it to work like
> > > > > input you probably need to file an enhancement ticket
> >
> > > > > --
> > > > > --
> >
> > > > > (the old fart) the advice is free, the lack of crankiness will cost
> you
> >
> > > > > - its a fine line between a real question and an idiot
> >
> > > > >
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
> > > > > http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
> > > > > http://blog.samdevore.com/cakephp-pages/i-cant-bake/
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---