title: How to refresh part of the page with AJAX or JSF?
body: <p>How to render part by part xhtml-page with Primefaces and Ajax (or without). Everything else is working, when the user press the checkbox, message is shown, but usernamecontent is never updated. How to refresh panelgrid in that case? I am totally newbie with AJAX, started today :)</p>
  
  <pre><code>&lt;h:outputLabel value="Do you want to create username?" for="description" /&gt;
      &lt;p:selectBooleanCheckbox value="#{testController.selectedNew.asUser}"&gt;  
      &lt;p:ajax update="msg" listener="#{testController.selectedNew.addMessage()}"/&gt;
      &lt;p:ajax update="usernamecontent"/&gt; ------&gt; **This is not working!**
      &lt;/p:selectBooleanCheckbox&gt;  
  
      &lt;h:panelGrid columns="2" id="usernamecontent" rendered="#{testController.selected.asUser}"&gt;
      &lt;h:outputLabel value="#{bundle.CreateUserLabel_userUsername}" for="username" /&gt;
      &lt;p:inputText id="username" value="#{testController.selectedNew.userUsername.username}" title="#{bundle.CreateUsersTitle_username}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_username}"/&gt;
  
      &lt;h:outputLabel value="#{bundle.CreateUsersLabel_password}" for="password" /&gt;
      &lt;p:inputText id="password" value="#{testController.selectedNew.userUsername.password}" title="#{bundle.CreateUserTitle_password}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_password}"/&gt;
      &lt;/h:panelGrid&gt;
  </code></pre>
  
  <p>Thanks
  Sami</p>