title: How to use Ajax within Sonata Admin forms?
body: <p>I have a Merchant entity with the following fields and associations:-</p>
  
  <pre><code>/**
   * @ORM\ManyToMany(targetEntity="Category", inversedBy="merchants")
   */
  public $categories;
  
  /**
   * @ORM\ManyToMany(targetEntity="Tag", inversedBy="merchants")
   */
  public $tags;
  
  /**
   * @ORM\ManyToOne(targetEntity="Category", inversedBy="merchants")
   */
  protected $primaryCategory;
  
  /**
   * @ORM\ManyToOne(targetEntity="Tag", inversedBy="merchants")
   */
  protected $primaryTag;
  </code></pre>
  
  <p>The Tags and Categories also have a ManyToMany mapping. 
  So we have Tag_Category, Merchant_Tag, Merchant_Category mapping tables. </p>
  
  <p>Now I want to perform some ajax on these fields. </p>
  
  <p>I want to allow the user to select the Primary Tag first. On the basis of the Primary Tag, ajax refresh the categories to only those which belong to this Tag and some more operations.</p>
  
  <p>How can I achieve this?</p>
  
  <p>Thanks!</p>