Did you read the entire chapter?
See 
http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms#chapter_06_saving_object_forms

cheers
Massimiliano

On 30 Mar, 19:56, Veríssimo <jveriss...@gmail.com> wrote:
> The echo was just a debug line, but I should only use the embed form
> only if the $this->getObject() != null. Because when it is null the
> embed form(Invoiceline) is saved with the variable invoiceid = null.
>
> thank you.
>
> On Mar 30, 2:20 pm, Massimiliano Arione <garak...@gmail.com> wrote:
>
> > You don't need to check.
> > The getObject() method returns null if no object associated, and this
> > is fine with form instance.
> > Just avoid to echo object's id in the form's configure.... why are you
> > doing this???
>
> > cheers
> > Massimiliano
>
> > On 30 Mar, 01:07, Veríssimo <jveriss...@gmail.com> wrote:
>
> > > I have implemented this, but i only have the Object after a previous
> > > have saved it.
>
> > > Do i have to do something like check ($this->getObject()) as a object?
>
> > >   public function configure()
> > >   {
> > >    $subForm = new sfForm();
> > >   for ($i = 0; $i < 2; $i++)
> > >   {
> > >     $linharecibo = new Linharecibo();
> > >     $linharecibo->Recibo = $this->getObject(); #This line does not
> > > have a object the first time
> > >     echo 'Raios'.$linharecibo->Recibo->getId();
> > >     $form = new LinhareciboForm($linharecibo);
>
> > >     $subForm->embedForm($i, $form);
> > >   }
> > >   $this->embedForm('Linhas', $subForm);
>
> > >   }

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to