title: Symfony2 form refresh same page after submit
body: <p>I have a form whose content is created from a DB.</p>
  <p>in my controller i have:</p>
  <pre><code>/**
   * @Route(&quot;/HR/manage/{projectID}&quot;, name=&quot;hr_manage&quot;)
   */
  public function manageHRAction(Request $request, $projectID)
  {
  //here I get all the data from DB and create the form
  if ($form-&gt;isValid()) 
      {
      //here I do all the relevant changes in the DB
      return $this-&gt;render('HR/show.html.twig', array('hrlist' =&gt; $HRsInMyDomain, 'form' =&gt; $form-&gt;createView(), 'HRs' =&gt; $HRsInThisProject, 'project' =&gt; $prj, ));
      }
  return $this-&gt;render('HR/show.html.twig', array('hrlist' =&gt; $HRsInMyDomain, 'form' =&gt; $form-&gt;createView(), 'HRs' =&gt; $HRsInThisProject, 'project' =&gt; $prj, ));
  }
  </code></pre>
  <p>It updates the info on the DB properly, but it does not build again the form with updated data. Instead of the return inside the &quot;isValid()&quot; I simply need a refresh on the current page.</p>
  <p>I assume it's possible and easy to accomplish, but I failed to find how to do it :/</p>
  <p>EDIT - here comes more relevant code:</p>
  <pre><code>/**
   * @Route(&quot;/HR/manage/{projectID}&quot;, name=&quot;hr_manage&quot;)
   */
  public function manageHRAction(Request $request, $projectID)
  {
  $user = $this-&gt;container-&gt;get('security.context')-&gt;getToken()-&gt;getUser(); //get current user
  $em = $this-&gt;getDoctrine()-&gt;getManager(); //connect to DB
  $prj = $this-&gt;getDoctrine()-&gt;getRepository('AppBundle:Project')-&gt;findOneById($projectID);
  [...]
  // here comes some code to generate the list of $HRsInThisProject and the list of roles ($rolesListForForm)
  [...]
  foreach ($HRsInThisProject as $key =&gt; $HR)
      {
      $form-&gt;add('roleOf_'.$key, 'choice', array('choices'   =&gt; $rolesListForForm, 'required'  =&gt; true, 'data' =&gt; $HR['role'], 'label' =&gt; false, ));
      $form-&gt;add('isActive_'.$key, 'choice', array('choices'   =&gt; [0 =&gt; 'Inactive', 1 =&gt; 'Active'] , 'required'  =&gt; true, 'data' =&gt; $HR['is_active'], 'label' =&gt; false, ));
      }
  [...]
  // here there is some code to get the $HRsInMyDomainForForm
  [...]
  $form-&gt;add('HRid', 'choice', array('choices' =&gt; $HRsInMyDomainForForm,'required' =&gt; false, 'placeholder' =&gt; 'Choose a resource', 'label' =&gt; false, ));
  $form-&gt;add('role', 'choice', array('choices' =&gt; $rolesListForForm,'required' =&gt; false, 'placeholder' =&gt; 'Choose a role', 'label' =&gt; false, ));            
  $form-&gt;add('save', 'submit', array('label' =&gt; 'Save'));     
  
  $form-&gt;handleRequest($request);
  
  if ($form-&gt;isValid()) 
      {
          {
          [...] here there is a huge portion of code that determines if I need to generate a new &quot;event&quot; to be stored, or even multiple events as I can change several form fields at once
  
          // If I needed to create the event I persist it (this is inside a foreach)
          $em-&gt;persist($newHREvent);
          }
      $em-&gt;flush();
      return $this-&gt;render('HR/show.html.twig', array('projectID' =&gt; $prj-&gt;getId(), 'hrlist' =&gt; $HRsInMyDomain, 'form' =&gt; $form-&gt;createView(), 'HRs' =&gt; $HRsInThisProject, 'project' =&gt; $prj, ));
      }
  return $this-&gt;render('HR/show.html.twig', array('projectID' =&gt; $prj-&gt;getId(), 'hrlist' =&gt; $HRsInMyDomain, 'form' =&gt; $form-&gt;createView(), 'HRs' =&gt; $HRsInThisProject, 'project' =&gt; $prj, ));
  }
  </code></pre>
  <p>I also include a screenshot of the form:
  <img src="https://i.stack.imgur.com/QD7iR.png" alt="enter image description here" /></p>
  <p>If a user selects to add a new resouce, I need to persist it to DB (and that is done properly) but then I need to see it in the list of available HRs, without the need for the user to reload the page.</p>