title: How to refresh parent jsf page from richfaces popup
body: <p>I have a JSF page with a few fields. I followed this <a href="http://balusc.blogspot.com/2011/01/jsf-20-tutorial-with-eclipse-and.html" rel="nofollow">tutorial</a> from BalusC and all is good. I then added RichFaces support to it, which is working fine. I can see popups etc working.</p>
  
  <p>Now what I am trying to do is that once a person has been registered, I want to show the name in the popup (this is also fine I can see that in the popup). Then I want to be able to change that name inside the popup and have that reflected in the parent, but I have no clue how to do that. Please have a look.</p>
  
  <p>XHTML Page</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"&gt;
  &lt;h:head&gt;
      &lt;title&gt;Registration&lt;/title&gt;
  &lt;/h:head&gt;
  &lt;h:body&gt;
      &lt;h:form&gt;
          &lt;h:panelGrid columns="3"&gt;
              &lt;h:outputLabel for="username"&gt;Username&lt;/h:outputLabel&gt;
              &lt;h:inputText id="username" value="#{register.user.username}"
                  required="true"&gt;
                  &lt;f:ajax event="blur" render="usernameMessage" /&gt;
              &lt;/h:inputText&gt;
              &lt;h:message id="usernameMessage" for="username" /&gt;
  
              &lt;h:outputLabel for="password"&gt;Password&lt;/h:outputLabel&gt;
              &lt;h:inputSecret id="password" value="#{register.user.password}"
                  required="true" redisplay="true"&gt;
                  &lt;f:ajax event="blur" render="passwordMessage" /&gt;
              &lt;/h:inputSecret&gt;
              &lt;h:message id="passwordMessage" for="password" /&gt;
  
              &lt;h:outputLabel for="email"&gt;Email&lt;/h:outputLabel&gt;
              &lt;h:inputText id="email" value="#{register.user.email}"
                  required="true"&gt;
                  &lt;f:ajax event="blur" render="emailMessage" /&gt;
              &lt;/h:inputText&gt;
              &lt;h:message id="emailMessage" for="email" /&gt;
  
              &lt;h:outputLabel for="birthdate"&gt;Birthdate (yyyy-MM-dd)&lt;/h:outputLabel&gt;
              &lt;h:inputText id="birthdate" value="#{register.user.birthdate}"&gt;
                  &lt;f:convertDateTime pattern="yyyy-MM-dd" /&gt;
                  &lt;f:ajax event="blur" render="birthdateMessage" /&gt;
              &lt;/h:inputText&gt;
              &lt;h:message id="birthdateMessage" for="birthdate" /&gt;
  
              &lt;h:panelGroup /&gt;
              &lt;h:commandButton value="Register" action="#{register.submit}"&gt;
                  &lt;f:ajax execute="@form" render="@form" /&gt;
              &lt;/h:commandButton&gt;
              &lt;h:commandButton value="Edit Name in Popup"&gt;
                  &lt;rich:componentControl target="popup" operation="show" /&gt;
              &lt;/h:commandButton&gt;
              &lt;h:messages globalOnly="true" layout="table" /&gt;
          &lt;/h:panelGrid&gt;
          &lt;rich:popupPanel id="popup" modal="true" resizeable="true"
              onmaskclick="#{rich:component('popup')}.hide()"&gt;
              &lt;f:facet name="header"&gt;
                  &lt;h:outputText value="Simple popup panel" /&gt;
              &lt;/f:facet&gt;
              &lt;f:facet name="controls"&gt;
                  &lt;h:outputLink value="#"
                      onclick="#{rich:component('popup')}.hide(); return false;"&gt;
                      X
                  &lt;/h:outputLink&gt;
              &lt;/f:facet&gt;
  
              &lt;h:panelGrid columns="3"&gt;
                  &lt;h:outputLabel for="username2"&gt;Username&lt;/h:outputLabel&gt;
                  &lt;h:inputText id="username2" value="#{register.user.username}"
                      required="true"&gt;
                  &lt;/h:inputText&gt;
                  &lt;h:commandButton value="Register" action="#{register.update}"&gt;
  
                  &lt;/h:commandButton&gt;
              &lt;/h:panelGrid&gt;
  
          &lt;/rich:popupPanel&gt;
      &lt;/h:form&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Java class</p>
  
  <pre><code>package com.example;
  
  import java.io.Serializable;
  
  import javax.faces.application.FacesMessage;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.ViewScoped;
  import javax.faces.context.FacesContext;
  
  @ManagedBean
  @ViewScoped
  public class Register implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      private User user;
  
      public Register() {
          user = new User();
      }
  
      public void submit() {
          FacesMessage message = new FacesMessage("Registration succesful!");
          FacesContext.getCurrentInstance().addMessage(null, message);
      }
  
      public void update() {
          FacesMessage message = new FacesMessage("Update succesful!");
          FacesContext.getCurrentInstance().addMessage(null, message);
      }
  
      public User getUser() {
          return user;
      }
  
  }
  </code></pre>
  
  <p>User Class</p>
  
  <pre><code> package com.example;
  
      import java.io.Serializable;
      import java.util.Date;
  
      public class User implements Serializable {
  
          private static final long serialVersionUID = 1L;
  
          private Long id;
          private String username;
          private String password;
          private String email;
          private Date birthdate;
          public Long getId() {
              return id;
          }
          public void setId(Long id) {
              this.id = id;
          }
          public String getUsername() {
              return username;
          }
          public void setUsername(String username) {
              this.username = username;
          }
          public String getPassword() {
              return password;
          }
          public void setPassword(String password) {
              this.password = password;
          }
          public String getEmail() {
              return email;
          }
          public void setEmail(String email) {
              this.email = email;
          }
          public Date getBirthdate() {
              return birthdate;
          }
          public void setBirthdate(Date birthdate) {
              this.birthdate = birthdate;
          }
  
      }
  </code></pre>
  
  <p><strong>Updated bit after Arjan Tijms' suggestion</strong></p>
  
  <pre><code>&lt;h:form id="form2"&gt;
      &lt;rich:popupPanel id="popup" modal="true" resizeable="true" onmaskclick="#{rich:component('popup')}.hide()"&gt;
          &lt;f:facet name="header"&gt;
              &lt;h:outputText value="Simple popup panel" /&gt;
          &lt;/f:facet&gt;
          &lt;f:facet name="controls"&gt;
              &lt;h:outputLink value="#" onclick="#{rich:component('popup')}.hide(); return false;"&gt;
                  X
              &lt;/h:outputLink&gt;
          &lt;/f:facet&gt;
  
          &lt;h:panelGrid columns="3"&gt;
              &lt;h:outputLabel for="username2"&gt;Username&lt;/h:outputLabel&gt;
              &lt;h:inputText id="username2" value="#{register.user.username}" required="true"&gt;&lt;/h:inputText&gt;
              &lt;h:commandButton value="Register" action="#{register.update}"&gt;
                  &lt;f:ajax execute="@form" render=":form" /&gt;
              &lt;/h:commandButton&gt;
          &lt;/h:panelGrid&gt;
  
      &lt;/rich:popupPanel&gt;
  &lt;/h:form&gt;
  </code></pre>