This fixed it. Property needed to be assigned.
$this->add(new EntityChoiceField('salesRep', array(
'em' => $em,
'class' => 'Sensio\HelloBundle\Entity\User',
'property' => 'firstName',
'query_builder' => function ($repository) {
return $reposit
Ok. The choice field shows up, but that's it. It doesn't populate with my
data and it causes the form fields after it to disappear.
Here's the attempt...
namespace Sensio\HelloBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\HelloBundle\Form\JobForm;
use
Le 11/02/2011 20:30, jdewit a écrit :
I'm trying to use the entityToIdTransformer in a form so I can
populate a choiceField dynamically.
Here's my code.
namespace Sensio\HelloBundle\Form;
use Symfony\Component\Form\Form;
use
Symfony\Bundle\DoctrineBundle\Form\ValueTransformer\EntityToIDTrans
I'm trying to use the entityToIdTransformer in a form so I can populate a
choiceField dynamically.
Here's my code.
namespace Sensio\HelloBundle\Form;
use Symfony\Component\Form\Form;
use
Symfony\Bundle\DoctrineBundle\Form\ValueTransformer\EntityToIDTransformer;
use Symfony\Component\Form\Choic
I'm trying to use the entityToIdTransformer in a form so I can populate a
choiceField dynamically.
Here's my code.
namespace Sensio\HelloBundle\Form;
use Symfony\Component\Form\Form;
use
Symfony\Bundle\DoctrineBundle\Form\ValueTransformer\EntityToIDTransformer;
use Symfony\Component\Form\Choic