tag:blogger.com,1999:blog-3437262335854972639.post7217585875870922882..comments2023-10-23T20:32:31.349+02:00Comments on The blog about 12wiki and other technical stuff: Speeding up the rendering of entity dropdowns in forms in Symfony 2Tom Maaswinkelhttp://www.blogger.com/profile/09653096635878748961noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-3437262335854972639.post-35346449182979469962014-12-03T17:30:01.646+01:002014-12-03T17:30:01.646+01:00An interesting bundle forresolve your problem is:
...An interesting bundle forresolve your problem is:<br />https://github.com/PUGX/PUGXAutoCompleterBundle<br /><br />But also is interesting how to writing-hydration-method:<br />http://doctrine.readthedocs.org/en/latest/en/manual/data-hydrators.html#writing-hydration-method<br /><br />OdaepoOnirhttps://www.blogger.com/profile/04051931596412062868noreply@blogger.comtag:blogger.com,1999:blog-3437262335854972639.post-22517777948937496472014-03-12T08:59:23.150+01:002014-03-12T08:59:23.150+01:00Hi TOM Maaswinkel.
Me also facing same problem as...Hi TOM Maaswinkel.<br /><br />Me also facing same problem as mention previously by Frcho ...I tried with your suggestion but no improvement. Nijanthan@nijuhttps://www.blogger.com/profile/13268887304278242864noreply@blogger.comtag:blogger.com,1999:blog-3437262335854972639.post-85495978425793904592014-01-11T17:49:05.093+01:002014-01-11T17:49:05.093+01:00Hi,
I know this is quite old post, but I just got...Hi,<br /><br />I know this is quite old post, but I just got an issue, using this optimization. After I swap from using class type field in the form builder I got a problem at the saving in db. My entity has an entity field (ManyToOne) which is expecting an object but got an integer. How should I deal with this? I didn't find yet a reliable explanation.<br />Thanks in advance.barneyhttps://www.blogger.com/profile/07855725823550532625noreply@blogger.comtag:blogger.com,1999:blog-3437262335854972639.post-75024553760195437272012-12-07T09:28:09.462+01:002012-12-07T09:28:09.462+01:00Hey Frcho,
this has to do with the following line...Hey Frcho,<br /><br />this has to do with the following lines of code (from the controller):<br /><br />$em = $this->getDoctrine()->getManager();<br />/* ... */<br />$form = $this->createForm(new OrderType($em), $entity);<br /><br />Here you need to pass $em to your form class(in my case OrderType)Tom Maaswinkelhttps://www.blogger.com/profile/09653096635878748961noreply@blogger.comtag:blogger.com,1999:blog-3437262335854972639.post-68095925983523142852012-12-07T06:42:31.865+01:002012-12-07T06:42:31.865+01:00Hi,I get the following error
Catchable Fatal Err...Hi,I get the following error<br /><br /><br />Catchable Fatal Error: Argument 1 passed to Quindimotos\ProyectoBundle\Form\ClienteType::__construct() must be an instance of Doctrine\ORM\EntityManager, none given, called in C:\wamp\www\proyectofinal\src\Quindimotos\ProyectoBundle\Controller\ClienteController.php on line 71 and defined in C:\wamp\www\proyectofinal\src\Quindimotos\ProyectoBundle\Form\ClienteType.php line 18<br /><br />I Can you help me, I donĀ“t know to do.Frchohttps://www.blogger.com/profile/03912891007610213179noreply@blogger.comtag:blogger.com,1999:blog-3437262335854972639.post-49654088516468743492012-11-28T10:24:59.223+01:002012-11-28T10:24:59.223+01:00Hi,
First thank you very much for replying. I ...Hi, <br /> First thank you very much for replying. I am using manytoone relation in ORM. While generating the form for the users table it is trying to get the related field from security table. The security table entity is connecting to the default database(admin). But we have both users and security table in client database(dynamic). Is there any way to point entity to client database(dynamic).prabhuhttps://www.blogger.com/profile/04332138428544462990noreply@blogger.comtag:blogger.com,1999:blog-3437262335854972639.post-55816080284765226832012-11-28T07:46:34.651+01:002012-11-28T07:46:34.651+01:00Hey Prabhu,
You mention you have two databases, bu...Hey Prabhu,<br />You mention you have two databases, but both tables (users and security) are in the same database? If this is the case you should be able to use the standard 'entity' formfield to render a dropdown/checkboxes of your users. Check http://symfony.com/doc/current/book/forms.html, http://symfony.com/doc/current/reference/forms/types/entity.html and http://symfony.com/doc/current/book/doctrine.html#relationship-mapping-metadata for more info.<br /><br />If something doesn't work because of the multiple databases, I'd suggest to take a look at http://symfony.com/doc/2.0/cookbook/doctrine/multiple_entity_managers.html<br /><br />If this doesn't answer your question, let me know by adding a reply, or you can send me an e-mail via my blogspot profile (just click 'View my complete profile' on the right right and then click 'e-mail' on the left of the page).<br /><br />Cheers,<br />TomTom Maaswinkelhttps://www.blogger.com/profile/09653096635878748961noreply@blogger.comtag:blogger.com,1999:blog-3437262335854972639.post-82107988625840122392012-11-28T07:21:16.757+01:002012-11-28T07:21:16.757+01:00Hi Tom Maaswinkel,
I working with two databases(ad...Hi Tom Maaswinkel,<br />I working with two databases(admin and client). My default database is admin. I have got two tables(users and security) in client database. I need to get the values(from one field) from security table to the users(to the another column like a drop-down) table. I referred many sites and gone through many options but no go. Can u please help in fixing this issue. Thanks in advance.prabhuhttps://www.blogger.com/profile/04332138428544462990noreply@blogger.comtag:blogger.com,1999:blog-3437262335854972639.post-9274370597865893272012-11-26T08:26:09.029+01:002012-11-26T08:26:09.029+01:00Hey Tito,
I looked into this last weekend and I to...Hey Tito,<br />I looked into this last weekend and I totally agree with you, thanks for the heads-up. I'll also check into https://github.com/symfony/symfony/issues/5098 and see if I can create a graceful solution that can be merged into master.<br />- TomTom Maaswinkelhttps://www.blogger.com/profile/09653096635878748961noreply@blogger.comtag:blogger.com,1999:blog-3437262335854972639.post-5388812648369955542012-11-26T00:18:12.553+01:002012-11-26T00:18:12.553+01:00I think you should create a new field type and use...I think you should create a new field type and use a data converter. check both on symfony documentation, there are cookbook entries.Tito Miguel Costahttps://www.blogger.com/profile/04524257976432357569noreply@blogger.com