3 Replies Latest reply on Oct 21, 2009 6:08 AM by strannik

    rich:editor not working correctly on a rich:modalPanel

    maguri

      Hi,

      I have a simple rich:editor inside a rich:modalPanel. It is getting rendered correctly but i cant type anything in the edit area (cursor wont get in the editing area)

      I'm using Facelets and Richfaces 3.3.0.

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
      
      <rich:modalPanel id="planHistPup" minHeight="300" minWidth="450" >
       <f:facet name="header">
       <h:outputText value="#{msg['indicator.lblComments']}" />
       </f:facet>
       <f:facet name="controls">
       <h:graphicImage value="/imagenes/close.png" style="cursor:pointer"
       onclick="Richfaces.hideModalPanel('planHistPup')" />
       </f:facet>
       <h:form>
       <a4j:outputPanel id="planHistComments" layout="inline">
       <br/>
       <h:panelGrid columns="1" style="margin:0px auto;">
       <h:outputText value="#{msg['indicator.text4']}"/>
       <rich:editor id="editor" width="430" height="180"
       value="#{planIndicatorHistValueController.valueComments}" />
       </h:panelGrid>
       <br/>
       <h:panelGroup>
       <h:commandButton value="#{msg['common.continueBtn']}"
       actionListener="#{planIndicatorHistValueController.saveValueComments}"
       onclick="Richfaces.hideModalPanel('planHistPup')"></h:commandButton>
       <h:commandButton value="#{msg['common.cancelBtn']}"
       onclick="Richfaces.hideModalPanel('planHistPup')"></h:commandButton>
       </h:panelGroup>
       </a4j:outputPanel>
       </h:form>
      </rich:modalPanel>
      
      </ui:composition>


      Perhaps there is something wrong with my code?

      Thanks in advance for any help

        • 1. Re: rich:editor not working correctly on a rich:modalPanel
          nbelaevski

          Hello,

          Please take a look at this issue: https://jira.jboss.org/jira/browse/RF-5268

          • 2. Re: rich:editor not working correctly on a rich:modalPanel
            strannik

            I applied workaround but still couldn't move focus to editor. My code

             <rich:modalPanel id="newsWindow" autosized="true" width="350" domElementAttachment="parent">
             <f:facet name="header">
             <h:panelGroup>
             <h:outputText value="#{msg['news.add']}" />
             </h:panelGroup>
             </f:facet>
             <f:facet name="controls">
             <h:panelGroup>
             <rich:componentControl for="newsWindow" attachTo="cancel"
             operation="hide" event="onclick" />
             </h:panelGroup>
             </f:facet>
            
             <h:form id="editForm">
             <a4j:outputPanel ajaxRendered="true">
             <h:messages id="error" />
             </a4j:outputPanel>
            
             <h:panelGrid columns="2" styleClass="label left" id="fieldsGrid">
             <h:outputText value="#{msg['news.title']}" />
             <h:inputText id="title" size="30" value="#{currentNews.title}"
             required="true" requiredMessage="#{msg['news.title.required']}" />
             <h:outputText value="#{msg['news.text']}" />
             <rich:editor id="editor" width="330"
             height="150" value="#{currentNews.text}" />
             </h:panelGrid>
             <script type="text/javascript">
             function windowclose(){
             if (document.getElementById('editForm:error')==null){
             Richfaces.hideModalPanel('newsWindow');
             };
             };
             </script>
             <div class="buttonGroup"><a4j:commandButton id="save"
             action="#{adminController.saveAnnouncement(currentNews, adminBean)}" reRender="newsForm"
             value="#{msg['buttons.save']}"
             oncomplete="windowclose();">
             </a4j:commandButton> <a4j:commandButton id="cancel" oncomplete="Richfaces.hideModalPanel('newsWindow');"
             value="#{msg['buttons.cancel']}" immediate="true">
             </a4j:commandButton></div>
            
             </h:form>
             </rich:modalPanel>
            
            


            • 3. Re: rich:editor not working correctly on a rich:modalPanel
              strannik

              Any updates? Actually I used workaround from https://jira.jboss.org/jira/browse/RF-5268.