title: Richfaces modal panel and a4j:keepAlive
body: <p>I've got unexpected problems with richfaces (3.3.2) modal panel. When i try to open it, browser opens two panels instead of one: one is in the center, another is in the upper left corner. Besides, no fading happens. Also i have three modes: view, edit, new - and when i open my panel it should show either "Create new..." or "Edit..." in the header and actually it shows but not in the header as the latter isn't rendered at all though it should, because i set proper mode in action before opening this modal panel. Besides it works fine on all other pages i've made and there are tens of such pages in my application. I can't understand what's wrong here. The only way to fix it is to remove &lt;a4j:keepAlive/&gt; from the page that is very strange, imho.</p>
  
  <p>I'm not sure if code will be usefull here as it works fine everywhere in my application but this only case. So if you put it on your page it will probably work without problems. My only question is: are there any hidden or rare problems in interaction of these two elements (&lt;rich:modalPanel&gt; and &lt;a4j:keepAlive&gt;)? Or shall i spent another two or three days searching for some wrong comma, parenthesis or whatever in my code? :)</p>
  
  <p>For most curious. Panel itself:</p>
  
  <pre><code>&lt;!-- there's no outer form --&gt;
      &lt;rich:modalPanel id="panel" autosized="true" minWidth="300" minHeight="200"&gt;
          &lt;f:facet name="header"&gt;
              &lt;h:panelGroup id="panelHeader"&gt;
              &lt;h:outputText value="#{msg.new_smth}" rendered="#{MbSmth.newMode}"/&gt;
              &lt;h:outputText value="#{msg.edit_smth}" rendered="#{MbSmth.editMode}"/&gt;
              &lt;/h:panelGroup&gt;
          &lt;/f:facet&gt;
          &lt;h:panelGroup id="panelDiv"&gt;
              &lt;h:form &gt;
                  &lt;!-- fields and buttons --&gt;
              &lt;/h:form&gt;
          &lt;/h:panelGroup&gt;
      &lt;/rich:modalPanel&gt;
  </code></pre>
  
  <p>One of the buttons that open panel:</p>
  
  <pre><code>&lt;a4j:commandButton id="addBtn"
              reRender="panelHeader, panelDiv"
              value="#{form.add}"
          oncomplete="#{rich:component('panel')}.show()"
              action="#{MbSmth.add}"
              image="create.gif"/&gt;
  </code></pre>
  
  <p>Action invoked on button click:</p>
  
  <pre><code>public void add() {
      curMode = NEW_MODE; // initial mode is VIEW_MODE
      newSmth = new Smth();
  }
  </code></pre>
  
  <p>Mode check:</p>
  
  <pre><code>public boolean isNewMode() {
      return curMode == NEW_MODE;
  }
  
  public boolean isEditMode() {
      return curMode == EDIT_MODE;
  }
  </code></pre>