title: Updating multiple elements using AJAX
body: <p>I'm trying to have multiple elements update when a selectOneMenu's item has been selected.</p>
  
  <p>Right now it works for a single element that needs updating, I did this by following <a href="https://stackoverflow.com/questions/14790014/ajax-update-render-does-not-work-on-a-component-which-has-rendered-attribute">this question's accepted answer</a>, but since I'm working with <code>id</code> attributes, I can't re-use that.</p>
  
  <p>After searching SO and various other sites (such as <a href="https://www.google.nl/webhp?sourceid=chrome-instant&amp;ion=1&amp;espv=2&amp;ie=UTF-8#q=jsf%20update%20outputtext%20from%20bean" rel="nofollow noreferrer">this search</a>, and a search I did on Google named <em>jsf ajax update outputtext</em>, I can't post the link since I don't have 10 rep), I'm just kind of stuck.</p>
  
  <p>How do I proceed?</p>
  
  <p>The AJAX call is being made from here:</p>
  
  <pre><code>&lt;h:form class="navbar-form"&gt; 
      &lt;h:selectOneMenu value="#{formHeader.selectedPersonId}" class="form-control"&gt;
          &lt;f:selectItems value="#{persons.persons}" var="person" itemValue="#{person.id}" itemLabel="${person.fullName}"/&gt;
          &lt;f:ajax event="change"   listener="#{formHeader.impersonateListener}"  render=":selected-person" /&gt;        
      &lt;/h:selectOneMenu&gt;
  &lt;/h:form&gt;     
  </code></pre>
  
  <p>Which successfully updates this part:</p>
  
  <pre><code>&lt;!-- https://stackoverflow.com/questions/14790014/ajax-update-render-does-not-work-on-a-component-which-has-rendered-attribute --&gt;
  &lt;h:panelGroup id="selected-person"&gt;
      &lt;h:outputText&gt;${auth.authPerson.fullName}&lt;/h:outputText&gt;
  &lt;/h:panelGroup&gt;
  </code></pre>
  
  <p>But now also needs to update the <code>&lt;h:outputText&gt;</code> here:</p>
  
  <pre><code>&lt;h:outputText value="#{auth.authPerson.fullName}"/&gt;
  &lt;span&gt;Working @&lt;/span&gt;
  &lt;span&gt;Doing bla ....&lt;/span&gt;
  &lt;span&gt;messages&lt;/span&gt;
  </code></pre>
  
  <p>I'm quite new to JSF just as a heads up. I'm probably doing something trivially wrong or missing something very obvious.</p>