Symfony Embedded form relation
I'm using Symfony 1.4.8
The Problem is in saving embedded form relation to database. I have child and parent; child is embedded form, when I'm using embedded form parent is always connected with the same child and I cannot change child by select-box from parent form. But if I comment embedding child then all works fine. I'm using AJAX 开发者_JAVA百科to change child form values and after bind form with child, got right values but Symfony don't use them.
My guess, there are some protected values that I cannot see which tells object what connection was originally between parent and child and save function restores this connection for some security reason. Maybe I'm wrong, can somebody help?!
Here is code snippet where my code is ending and where I'm passing right values to symfony
protected function processForm(sfWebRequest $request, sfForm $form)
{
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
if ($form->isValid())
{
$values = $form->getValues(); //test
var_dump($values); //test
$sf_guard_user = $form->save();
return false; //test
//$this->redirect('user/edit?id='.$sf_guard_user->getId()); //origin
}
}
精彩评论