Am Mittwoch, 4. April 2012 11:40:10 UTC+2 schrieb Mike Griffin:
>
> On Tue, Apr 3, 2012 at 14:59, Wall-D wrote:
> > Here ist the problem:
> >
> > here ist the code from edit.ctp
> > ....................
> > <?php
> > $counter = 0;
> > foreach ($this->data['Detail'] as $detail):
> > echo
> > $this->Form->hidden('Detail.'.$counter.'.id',array( 'value' =>
> > $detail['id']));
> > echo
> > $this->Form->input('Detail'.$counter.'DetailType'.'name', array(
> > 'type' => 'select',
> > 'label' => 'Detail Art ',
> > 'selected' =>
> > $this->Form->data['Detail'][$counter].'detail_type_id',
> > 'div'=>'formfield',
> > 'error' => array(
> > 'wrap' => 'div',
> > 'class' => 'formerror'
> > )
> > ));
> > echo
> $this->Form->input('Detail.'.$counter.'.name',
> > array(
> > 'label' => 'Detail',
> > 'div'=>'formfield',
> > 'error' => array(
> > 'wrap' => 'div',
> > 'class' => 'formerror'
> > )
> > ));
> > $counter++;
> > endforeach;
> > ?>
> >
> > The selectBox(Detail Type) is empty, no option available. in the Textbox
> the
> > correct value is displayed.
>
> You aren't passing any options to the selectBox so it has nothing to
> show. Do you want to pick from the entire list of DetailTypes?
>
> Try finding all DetailType as a list and using that as the options for
> the SelectBox.
>
> Mike.
>
Yes, it should be the list of all detail-types with the correct one
selected.
in the controller I'm passing them to the view:
' $detail_types = $this->Device->Detail->DetailType->find('list',
array('order' => 'DetailType.name ASC'));
and the label shows up the correct DetailType
I tried many combinations, but nothing worked for me ...
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php