title: Richfaces 4 popup editor woes
body: <p>Richfaces 4.2.2</p>
  
  <p>I have added a button within a rich:datatable that causes a rich:popup panel to appear. The popup panel contains a <code>&lt;rich:editor/&gt;</code> and 2 <code>&lt;h:commandButton/&gt;</code>s</p>
  
  <p>The button in the datatable calls a method in the backing bean to set the String to be edited, and the editor is mapped to this attribute - I know that the button is setting the String in the backing bean.</p>
  
  <p>I have also added an <code>&lt;h:outputText/&gt;</code> to the popup panel to show the value of the String to be edited</p>
  
  <p>The problems are:</p>
  
  <ol>
  <li>When the editor displays, the edit panel cannot be used until the source button has been pressed a couple of time to put it into and out of source mode</li>
  <li>The value of the backing bean attribute is not displayed in the editor</li>
  <li>The commandButton mapped to a method in the backing bean does not call the method</li>
  <li>The outputText shows the correct value the first time but it does not change on subsequent uses of the popup panel when different rows in the datatable are used</li>
  </ol>
  
  <p>I have tried with the popup and datatable in the same for and in separate forms and have tried the separate form both inside and outside the popup panel</p>
  
  <p>Here is the page</p>
  
  <pre><code>    &lt;h:html xmlns="http://www.w3c.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich"&gt;
  
   .
   .
   .
      &lt;h:form id="blogForm" prependId="false"&gt;
  
        &lt;rich:popupPanel  id="mp" minHeight="600" minWidth="450"  height="600" width="800" resizeable="true"&gt;
          &lt;f:facet name="header"&gt;
              &lt;h:outputText value="Modal Panel Title" /&gt;
          &lt;/f:facet&gt;
  
          &lt;rich:editor id="editor" toolbar="full" value="#{blogBean.currentEntry}" skin="office2003" viewMode="visual"&gt;
            &lt;f:param name="auto_focus" value="editor" /&gt;
          &lt;/rich:editor&gt;
  
          &lt;h:outputText escape="false" value=")))#{blogBean.currentEntry}(((" /&gt;
  
          &lt;h:commandButton value="Save" action="#{blogBean.save}"&gt;
            &lt;rich:componentControl target="mp" operation="hide" /&gt;  
          &lt;/h:commandButton&gt;
          &lt;h:commandButton value="Cancel" &gt;
            &lt;rich:componentControl target="mp" operation="hide" /&gt;  
          &lt;/h:commandButton&gt;
        &lt;/rich:popupPanel&gt;
  
  
       &lt;a4j:commandButton value="Add new post" rendered="true" &gt;
         &lt;rich:componentControl target="mp" operation="show" /&gt;
       &lt;/a4j:commandButton&gt;
  
       &lt;h:panelGrid columns="1"&gt;
         &lt;a4j:outputPanel id="panel" layout="block"&gt;                
           &lt;rich:dataTable value="#{blogBean.entries}" columns="1" var="entry" rows="20" id="repeat" &gt;
                   &lt;rich:column width="800"&gt;
                       &lt;rich:panel&gt;
                         &lt;f:facet name="header"&gt;
                            &lt;a4j:commandButton value="Edit" rendered="true" oncomplete="#{rich:component('mp')}.show()"&gt;
                              &lt;f:setPropertyActionListener value="#{entry}" target="#{blogBean.currentEntry}" /&gt;
                            &lt;/a4j:commandButton&gt;
                         &lt;/f:facet&gt;
                         &lt;h:outputText escape="false" value="#{entry}" /&gt;
                       &lt;/rich:panel&gt;
               &lt;/rich:column&gt;
           &lt;/rich:dataTable&gt;            
         &lt;/a4j:outputPanel&gt;            
      &lt;/h:panelGrid&gt;   
      &lt;/h:form&gt;
    &lt;/h:body&gt;
  
  &lt;/h:html&gt;
  </code></pre>