7 Replies Latest reply on Nov 27, 2009 4:00 PM by neps

    Editor dont works in ModalPanel

    neps

      So, i get the last stable version(3.2.2) and i use rich:editor in the modalpanel and dont works.
      He still broken my application, after the reading the page of editor all the components stop work.
      this is bug?

      my cod:
      ...
      <rich:modalPanel id="documento" height="600" width="620">
      <f:facet name="header">
      <h:outputText value="Documento"/>
      </f:facet>
      <a4j:form>
      <rich:editor value="#{disciplina.documento}" />
      </a4j:form>
      </rich:modalPanel>
      ...

      Error javascript:
      ...

      G.win.document is null
      [Break on this error] }}catch(F){}if(!I){I=A?G.win.document.bo...extRange():G.win.document.createRange()\n

      ...
      Thanks

        • 1. Re: rich:editor dont works in rich:modalPanel
          neps

           

          "neps" wrote:
          So, i get the last stable version(3.2.2) and i use rich:editor in the rich:modalpanel and dont works.
          He still broken my application, after the reading the page of rich:editor all the components stop work.
          this is bug?

          my cod:
          ...
          <rich:modalPanel id="documento" height="600" width="620">
          <f:facet name="header">
          <h:outputText value="Documento"/>
          </f:facet>
          <a4j:form>
          <rich:editor value="#{disciplina.documento}" />
          </a4j:form>
          </rich:modalPanel>
          ...

          Error javascript:
          ...

          G.win.document is null
          [Break on this error] }}catch(F){}if(!I){I=A?G.win.document.bo...extRange():G.win.document.createRange()\n

          ...
          Thanks


          • 2. Re: Editor dont works in ModalPanel
            juangon

            Last version is 3.3.2 SR1 AFAIK.

            And probably the solution for modalPanel is setting "domElementAttachment attribute to "parent".

            • 3. Re: Editor dont works in ModalPanel
              neps

               

              "juangon" wrote:
              Last version is 3.3.2 SR1 AFAIK.

              And probably the solution for modalPanel is setting "domElementAttachment attribute to "parent".


              I dont understand your solution, i thought the problem was the modal but i tried with other modal(jquery.dialog) and the problem persists.
              The problem is resolved with editor outer in modal. but all the system has form in the modalpanel.

              You have code for your tip?!

              Thanks!

              • 4. Re: Editor dont works in ModalPanel
                ilya_shaikovsky

                the problem is caused by the fact that modal moved within DOM tree to became the body direct children before show. (described in documentation). So editor just lost elements to which attached. Do not change nothing but just add domElementAttachment="parent" to modal panel to prevent modal from default behavior usage.

                • 5. Re: Editor dont works in ModalPanel
                  neps

                   

                  "ilya_shaikovsky" wrote:
                  the problem is caused by the fact that modal moved within DOM tree to became the body direct children before show. (described in documentation). So editor just lost elements to which attached. Do not change nothing but just add domElementAttachment="parent" to modal panel to prevent modal from default behavior usage.


                  \o/... Very thanks(to two), I had more one problem because i have modal in the modal but the problem been resolved with the same solution, this:


                  <rich:modalPanel id="modalDisciplinaGrade" domElementAttachment="parent">
                  ...
                  <a4j:commandButton type="button" value="Documento" oncomplete="#{rich:component('documentoDisciplina')}.show()" reRender="documentoDisciplina" />
                  ...
                  </rich:modalPanel>
                  <rich:modalPanel id="documentoDisciplina" domElementAttachment="parent">
                  <f:facet name="header">
                  <h:outputText value="Teste"/>
                  </f:facet>
                  </rich:modalPanel>




                  • 6. Re: Editor dont works in ModalPanel
                    juangon

                     

                    "neps" wrote:
                    "ilya_shaikovsky" wrote:
                    the problem is caused by the fact that modal moved within DOM tree to became the body direct children before show. (described in documentation). So editor just lost elements to which attached. Do not change nothing but just add domElementAttachment="parent" to modal panel to prevent modal from default behavior usage.


                    \o/... Very thanks(to two), I had more one problem because i have modal in the modal but the problem been resolved with the same solution, this:


                    <rich:modalPanel id="modalDisciplinaGrade" domElementAttachment="parent">
                    ...
                    <a4j:commandButton type="button" value="Documento" oncomplete="#{rich:component('documentoDisciplina')}.show()" reRender="documentoDisciplina" />
                    ...
                    </rich:modalPanel>
                    <rich:modalPanel id="documentoDisciplina" domElementAttachment="parent">
                    <f:facet name="header">
                    <h:outputText value="Teste"/>
                    </f:facet>
                    </rich:modalPanel>

                    I had some problem like that many months ago, I guess you can't reRender the whole modalPanel, you only will be able to reRender a part of it. Using your example:

                    <a4j:commandButton type="button" value="Documento" oncomplete="#{rich:component('documentoDisciplina')}.show()" reRender="documentoDisciplinaBody" />
                    
                    .
                    .
                    <rich:modalPanel id="documentoDisciplina" domElementAttachment="parent">
                     <f:facet name="header">
                     <h:outputText value="Teste"/>
                     </f:facet>
                     <a4j:outputPanel id="documentoDisciplinaBody">
                     <body tags here>
                     </a4j:outputPanel>
                    </rich:modalPanel>
                    


                    • 7. Re: Editor dont works in ModalPanel
                      neps

                       

                      "juangon" wrote:
                      "neps" wrote:
                      "ilya_shaikovsky" wrote:
                      the problem is caused by the fact that modal moved within DOM tree to became the body direct children before show. (described in documentation). So editor just lost elements to which attached. Do not change nothing but just add domElementAttachment="parent" to modal panel to prevent modal from default behavior usage.


                      \o/... Very thanks(to two), I had more one problem because i have modal in the modal but the problem been resolved with the same solution, this:


                      <rich:modalPanel id="modalDisciplinaGrade" domElementAttachment="parent">
                      ...
                      <a4j:commandButton type="button" value="Documento" oncomplete="#{rich:component('documentoDisciplina')}.show()" reRender="documentoDisciplina" />
                      ...
                      </rich:modalPanel>
                      <rich:modalPanel id="documentoDisciplina" domElementAttachment="parent">
                      <f:facet name="header">
                      <h:outputText value="Teste"/>
                      </f:facet>
                      </rich:modalPanel>

                      I had some problem like that many months ago, I guess you can't reRender the whole modalPanel, you only will be able to reRender a part of it. Using your example:

                      <a4j:commandButton type="button" value="Documento" oncomplete="#{rich:component('documentoDisciplina')}.show()" reRender="documentoDisciplinaBody" />
                      
                      .
                      .
                      <rich:modalPanel id="documentoDisciplina" domElementAttachment="parent">
                       <f:facet name="header">
                       <h:outputText value="Teste"/>
                       </f:facet>
                       <a4j:outputPanel id="documentoDisciplinaBody">
                       <body tags here>
                       </a4j:outputPanel>
                      </rich:modalPanel>
                      


                      Well, this way it's ok.. but i can improve the content. anyway very thanks again.