As far as i can see the problem could be that your expecting an
existing relation for your Polaroids, for new
objects this doesn't work.
Probably your $polaroids remain empty.
You should validate that case and create an empty new embedded form
like :
....
if ( !empty( $polaroids ) )
{
foreach($polaroids AS $polaroid)
{
$pform = new PolaroidForm($polaroid);
$this->embedForm($polaroid->getName(), $pform);
}
} else {
$pform = new PolaroidForm();
$this->embedForm('new_polaroid', $pform);
}
...
Jonathan Franks wrote:
> I'm trying to embed propel forms inside another propel form like this...
>
> class ProductForm extends BaseProductForm
> {
> public function configure()
> {
> $polaroids = $this->getObject()->getPolaroids();
> foreach($polaroids AS $polaroid)
> {
> $pform = new PolaroidForm($polaroid);
> $this->embedForm($polaroid->getName(), $pform);
> }
> }
> }
>
> The form is displayed with the embedded forms.
>
> The main form fields are auto-populated but the fields of the embedded
> forms are not.
>
> What must I do to autopopulate the embedded forms??
>
> Thankyou in advance, Jonathan.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---