title: JSF Language switcher and ajax update
body: <p>This question is a follow - up of the older <a href="https://stackoverflow.com/questions/10204001/language-switcher-implementation-in-jsf">Language switcher implementation in JSF 2</a>.</p>
  
  <p>The substance of the question is still valid, although PrimeFaces has released some newer builds, and my JSF knowledge is a bit better than before.</p>
  
  <p>To summarize, I have a single xhtml page, fully ajaxified.</p>
  
  <p>The language switcher is this:</p>
  
  <pre><code>&lt;h:form id="selectLanguage" &gt;
      &lt;p:commandLink action="#{languageSwitcher.setLanguage('it')}" rendered="#{languageSwitcher.language!='it'}" &gt;
          &lt;h:graphicImage library ="images" name="it.gif" title="it" /&gt;
      &lt;/p:commandLink&gt;
      &lt;p:commandLink action="#{languageSwitcher.setLanguage('en')}" rendered="#{languageSwitcher.language!='en'}" &gt;
          &lt;h:graphicImage library ="images" name="en.gif" title="en" /&gt;
      &lt;/p:commandLink&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>I want that when <strong><code>it</code></strong> is chosen, only the <strong><code>en</code></strong> flag is displayed, and viceversa. And I want that all the stuff in the web page is updated with the Resource Bundle translations.</p>
  
  <p>In particular, I have some <code>p:dialog</code>S whose header attributes need to be updated as well.
  The dialog forms are inside each dialog:</p>
  
  <pre><code>&lt;p:dialog header="#{msgs.myHeader}"  ... &gt;
      &lt;h:form .... /&gt;
  &lt;/p:dialog &gt;
  </code></pre>
  
  <p>The rest of the page is a <code>&lt;p:layout&gt;</code> containing some layoutUnits. Each <code>layoutUnit</code> contains a form with other components that need to be translated as well.</p>
  
  <p>LanguageSwitcher is a <code>SessionScoped</code> <code>JSF Managed Bean</code>.</p>
  
  <p>I have tried all of the following ways:</p>
  
  <ol>
  <li><code>&lt;f:ajax render="@all" /&gt;</code> inside the <code>p:commandLink</code> braces</li>
  <li><code>update="@all"</code> attribute inside <code>p:commandLink</code> </li>
  <li><code>&lt;p:ajax update="@all" /&gt;</code> inside the <code>p:commandLink</code> braces</li>
  </ol>
  
  <p>Unfortunately, none of them works.</p>
  
  <p>I have tried with <code>@all</code>, although I am available to insert the ids of the forms, they are not so many. Problem is that the dialog headers are not updated in this way.</p>
  
  <p>I am using PrimeFaces 3.4.1 - Mojarra 2.1.13</p>