title: SonataAdminBundle embebed form validation error
body: <p>I have an admin class, which included another admin class.</p>
  
  <ul>
  <li>Symfony 2.7.9 </li>
  <li>Sonata Admin Bundle 2.3.7</li>
  </ul>
  
  <p>I have it structured in tabs, and the problem is that when there is a validation error in any of the fields of the embedded form is not marked in any way the tab where it is located.</p>
  
  <p>This is my example code:
  Entity <strong>Products.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace AppBundle\Entity;
  
  use Doctrine\Common\Collections\ArrayCollection;
  use Doctrine\ORM\Mapping as ORM;
  use Symfony\Component\Validator\Constraints as Assert;
  
  /**
   * Products
   *
   * @ORM\Table()
   * @ORM\Entity(repositoryClass="AppBundle\Entity\ProductsRepository")
   */
  class Products
  {
  
      //...
  
      /**
       * 
       * @ORM\OneToMany(targetEntity="Modules", mappedBy="products", cascade={"persist"}, orphanRemoval=true)
       * @ORM\OrderBy({"position" = "ASC"})
       */
      protected $module;
  
      /**
       * Constructor
       */
      public function __construct()
      {
          $this-&gt;module= new ArrayCollection();
      }
  
      //...
  
      /**
       * Set module
       *
       * @param Doctrine\ORM\PersistentCollection $module
       * 
       */
      public function setModule(\Doctrine\ORM\PersistentCollection $module) {
  
          if (count($module) &gt; 0) {
              foreach ($module as $m) {
                  $this-&gt;addModule($m);
              }
          }
  
          return $this;
      }
  
      /**
       * Remove module
       *
       * @param \AppBundle\Entity\Modules $module
       */
      public function removeModule(\AppBundle\Entity\Modules $module)
      {
          foreach ($this-&gt;module as $k =&gt; $s) {
              if ($s-&gt;getId() == $module-&gt;getId()) {
                  unset($this-&gt;module[$k]);
              }
          }
  
      }
  
      /**
       * Get module
       *
       * @return \Doctrine\Common\Collections\Collection 
       */
      public function getModule()
      {
          return $this-&gt;module;
      }
  
  
      /**
       * Add module
       *
       * @param \AppBundle\Entity\Modules $module
       * @return Products
       */
      public function addModule(\AppBundle\Entity\Modules $module)
      {
          $module-&gt;setProducts($this);
          $this-&gt;module[] = $module;
  
      }
  
      //...
  
  }
  </code></pre>
  
  <p>Entity <strong>Modules.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  namespace AppBundle\Entity;
  
  use Doctrine\Common\Collections\ArrayCollection;
  use Doctrine\ORM\Mapping as ORM;
  use Symfony\Component\Validator\Constraints as Assert;
  
  /**
   * Modules
   *
   * @ORM\Table()
   * @ORM\Entity(repositoryClass="AppBundle\Entity\ModulesRepository")
   */
  class Modules
  {
      //...
  
      /**
       * @ORM\ManyToOne(targetEntity="Products", inversedBy="module")
       * @ORM\JoinColumn(name="product_id", referencedColumnName="id")
       */
      protected $products;
  
  
      /**
       * Constructor
       */
      public function __construct() {
          $this-&gt;products = new ArrayCollection();
      }
  
      /**
       * Set products
       *
       * @param \AppBundle\Entity\Products $products
       * @return Modules
       */
      public function setProducts(\AppBundle\Entity\Products $products = null)
      {
          $this-&gt;products = $products;
  
          return $this;
      }
  
      /**
       * Get products
       *
       * @return \AppBundle\Entity\Products 
       */
      public function getProducts()
      {
          return $this-&gt;products;
      }
  
      //...
  }
  </code></pre>
  
  <p>Entity <strong>admin.yml</strong></p>
  
  <pre class="lang-yml prettyprint-override"><code>services:
  
      sonata.admin.product.modules:
          class: AppBundle\Admin\ModulesAdmin
          tags:
              - {name: sonata.admin, manager_type: orm, label: Products}
          arguments:
              - ~
              - AppBundle\Entity\Modules
              - 'SonataAdminBundle:CRUD'
          calls:
              - [ setTranslationDomain, [ProductsAdmin]]
              - [ setLabelTranslatorStrategy, ["@sonata.admin.label.strategy.underscore"]]
  </code></pre>
  
  <p>Entity <strong>ProductsAdmin.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace AppBundle\Admin;
  
  class ProductsAdmin extends Admin {
  
      public $supportsPreviewMode = true;
      protected $formOptions = array(
          'cascade_validation' =&gt; true        
      );
  
      //...
  
      protected function configureFormFields(FormMapper $formMapper) {
  
          $formMapper
                  -&gt;tab('General')
                  -&gt;end()  
                  -&gt;tab('Modules')        
                      -&gt;add('module', 'sonata_type_collection', array(
                          'type_options' =&gt; array(
                              'delete' =&gt; true
                          )
                              ), array(
                          'edit' =&gt; 'inline',
                          'inline' =&gt; 'table',
                          'sortable' =&gt; 'position',
                          'admin_code' =&gt; 'sonata.admin.product.modules'
                      ))       
                  -&gt;end()   
          ;
      }
  
      public function prePersist($products) {
          $this-&gt;preUpdate($products);
      }
  
      public function preUpdate($products) {
  
          $products-&gt;setModule($products-&gt;getModule());
      }
  
      //...
  
  }
  </code></pre>
  
  <p>Entity <strong>ModulesAdmin.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace AppBundle\Admin;
  
  class ModulesAdmin extends Admin {
  
      public $supportsPreviewMode = true;
      protected $formOptions = array(
          'cascade_validation' =&gt; true
      );
      protected $baseRouteName = 'admin_app_product_modules';
      protected $baseRoutePattern = 'app/product-modules';
  
      //...
  
  }
  </code></pre>
  
  <p>I would like to know how to indicate the tab where the embedded form, there is a validation error in their fields is.</p>