8 Replies Latest reply on Jun 22, 2009 11:33 AM by David Herrera Alonso

    rich:editor on rich:modalPanel problem

    Sebastian Rzytki Newbie

      Hello
      I'm testing the rich:editor for our application and I found problem with using rich:editor placed on rich:modalPanel, are some limitations of using rich:editor? After showing rich:modalPanel, I'm getting rich editor without possiblities of entering any text, text area is completly uneditable.

      Have You similar problems.


      <rich:modalPanel id="#{id}" autosized="true">
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="Add Issue Comment"></h:outputText>
       </h:panelGroup>
       </f:facet>
       <h:form id="addIssueCommentForm">
       <h:inputHidden id="testowyId" value="#{addIssueCommentTagBean.issueId}"/>
       <h:panelGrid columns="3">
       <h:outputText value="Comment" />
       <rich:editor value="#{addIssueCommentTagBean.comment.comment}" />
       <rich:message for="issueCommentTextArea" />
       </h:panelGrid>
       <center><h:panelGrid columns="2">
       <a4j:commandButton id="addIssueCommentButton" value="Add Comment"
       oncomplete="#{rich:component(id)}.hide();return false;"
       actionListener="#{addIssueCommentTagBean.addIssueComment}"
       reRender="#{reRender}">
       </a4j:commandButton>
       <h:commandButton value="Cancel"
       oncomplete="#{rich:component(id)}.hide();return false;" />
       </h:panelGrid></center>
       </h:form>
       </rich:modalPanel>


      Best Regards
      Sebastian


        • 1. Re: rich:editor on rich:modalPanel problem
          Sebastian Rzytki Newbie

          Forgot: Tested on
          Browser: F3, IE7
          RichFaces: 3.3.0Beta2

          • 3. Re: rich:editor on rich:modalPanel problem
            aboo salimon Newbie

            no... still i am facing same problem eventhough i added domElementAttachment="parent" in modelpanel.

            <rich:modalPanel id="additionalRequestDlg" domElementAttachment="parent" minHeight="60" minWidth="500" height="60" width="500" zIndex="2000" moveable="true" resizeable="false" autosized="true">

            why so??? where i am wrong???

            • 4. Re: rich:editor on rich:modalPanel problem
              Nick Belaevski Master

               

              "aboocs01" wrote:
              no... still i am facing same problem eventhough i added domElementAttachment="parent" in modelpanel.

              <rich:modalPanel id="additionalRequestDlg" domElementAttachment="parent" minHeight="60" minWidth="500" height="60" width="500" zIndex="2000" moveable="true" resizeable="false" autosized="true">

              why so??? where i am wrong???
              Please post full page code.

              • 5. Re: rich:editor on rich:modalPanel problem
                lynxpack Newbie

                aboocs01: I was having a similar issue and in my case, I was using a4j:include to include the page that had the modalPanel with the editor. The workaround I used was to create a rich:editor object that was set to rendered="false" on my main page (where the a4j:includes were) to load the TinyMCE javascript.

                The reason for trying this is because my IE was showing javascript errors where TinyMCE.object = null.

                Hope this helps.

                • 6. Re: rich:editor on rich:modalPanel problem
                  David Herrera Alonso Newbie

                  Hi :)

                  In one daily build of RichFaces 3.3.2 (downloaded week ago), the workaround of JIRA5268 (put domElementAttachment="parent" on rich:editor) doesn't work.

                  I also have tested de last workaround proposed by LynxPack and doesn't work too.


                  The only thing that works me is set in rich:editor rendered="some method that return boolean". And when modalpanel is show, this 'some method' return false. Then, if I do something to force reRender rich:editor and that 'some method' return true, on that case rich:editor is fully operational.

                  But this behaviour isn't good. Any idea of how another workaround? Maybe we can submit another JIRA if JIRA5268's workaround doesn't work at all.

                  My modal panel code is this:

                  <rich:panel id="panelModal">
                   <rich:modalPanel id="modalEdit" width="1000" height="700" autosized="true">
                   <f:facet name="header">
                   <h:outputText id="titleModal" value="Editar bookmark #{bookmark.title} - #{bookmark.id}" />
                   </f:facet>
                   <a4j:outputPanel ajaxRendered="true">
                   <h:form style="display:none" prependId="false">
                   <h:inputHidden id="hasMessages" value="#{bookmarksManager.hasMessages()}" />
                   </h:form>
                   </a4j:outputPanel>
                   <a4j:form id="formModal">
                   <s:validateAll>
                   <h:outputText value="TiÂtulo"/>
                   <s:decorate>
                   <h:inputText value="#{bookmark.title}" required="true" />
                   </s:decorate>
                  
                   <h:outputText value="URL"/>
                   <s:decorate>
                   <h:inputText value="#{bookmark.url}" validator="#{bookmarksManager.validateUrl}" required="true" />
                   </s:decorate>
                  
                   <h:outputText value="Descripcion"/>
                   <s:decorate>
                   <rich:editor value="SOME TEXT TO SHOW" rendered="#{bookmarksManager.hasMessages()}"/>
                   </s:decorate>
                  
                  
                   <h:outputText value="Tags"/><br/>
                   <h:inputText value="#{bookmarksManager.inputTags}"/>
                  
                   <br/><h:outputText value="Público"/><br/>
                   <h:selectBooleanCheckbox value="#{bookmark.shared}"/>
                  
                   </s:validateAll>
                   <br/><a4j:commandButton id="save" value="Guardar" action="#{bookmarksManager.updateBookmark()}" reRender="bookmarkPanel, formModal"
                   oncomplete="if (document.getElementById('hasMessages').value=='false') Richfaces.hideModalPanel('modalEdit');" />
                   <rich:spacer width="10"/><a4j:commandButton id="cancel" value="Cerrar" onComplete="Richfaces.hideModalPanel('modalEdit', {})" reRender="panelModal, bookmarkPanel"/>
                   </a4j:form>
                   </rich:modalPanel>
                   </rich:panel>


                  Thanks.

                  • 7. Re: rich:editor on rich:modalPanel problem
                    David Herrera Alonso Newbie

                    Sorry for character errors in my code. Some Spanish character doesn't seem to work in "code" tag.

                    One thing more. As you can see in code, rich:editor doesn't have domElementAttachment="parent" and it works fine when I force reRender container form and rendered method (bookmarksManager.hasMessages()) return true.

                    • 8. Re: rich:editor on rich:modalPanel problem
                      David Herrera Alonso Newbie

                       

                      "Vidda" wrote:
                      Sorry for character errors in my code. Some Spanish character doesn't seem to work in "code" tag.

                      One thing more. As you can see in code, rich:editor doesn't have domElementAttachment="parent" and it works fine when I force reRender container form and rendered method (bookmarksManager.hasMessages()) return true.




                      Sorry again..... I have read wrong first workaround :(. I don't see that domElementAttachment="parent" attribute is for modal panel element... I have tested on rich editor element....


                      Sorry. Forget my three post. I would edit them but on this forum I can't see this option.


                      Thanks :).