7 Replies Latest reply on Mar 26, 2008 3:52 AM by fabmars

    rich:tab fckfaces js error

    liuliu

      hi,

      i am trying integrate fckfaces in my projet with ajax. i meet a problem when working with richtab.

      <?xml version="1.0" encoding="ISO-8859-1"?>
      
      <ui:composition template="/template/layout.xhtml"
       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:t="http://myfaces.apache.org/tomahawk"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
       xmlns:c="http://java.sun.com/jstl/core"
       xmlns:rich="http://richfaces.ajax4jsf.org/rich"
       xmlns:fck="http://www.fck-faces.org/fck-faces">
      
      <ui:define name="title"></ui:define>
      
      <ui:define name="content">
      
       <script type="text/javascript">
       //<![CDATA[
       function updatelink(){
       alert('titi')
       var editor = FCKeditorAPI.GetInstance("saisie:fckeditor1");
       editor.UpdateLinkedField();
       }
       //]]>
       </script>
      
      
       <rich:tabPanel switchType="client" >
       <rich:tab id="patient" label="Patient">
       <h:form id="saisie" onsubmit="updatelink();">
       <fck:editor toolbarSet="SigemToolbar" name="fckeditor1" id="fckeditor1" value="#{DocumentDetail.documentContent}" height="100%"
       width="800px" />
       </h:form>
       </rich:tab>
       <rich:tab id="dossier" label="Dossier">
       </rich:tab>
       </rich:tabPanel>
      
       </ui:define>
      </ui:composition>
      


      only with fckfaces, no problem
      with rich:tabpanel when mode client, no problem
      when mode ajax, i got a js error Error: the textarea with id or name set to "saisie:fckeditor1" was not found from tab dossier to tab patient

      when tabpanel is mode ajax, tab patient switchType is client, i got this js error from tab patient to tab dossier.

      PS: fckeditor creat a iframe to render html, textAera is a input hidden.

        • 1. Re: rich:tab fckfaces js error
          liuliu



          I did some more test. this problem is not exist for IE.

          • 2. Re: rich:tab fckfaces js error
            juanignaciosl

            Have you succeed using FCKFaces + RichFaces tabs in Ajax mode? I'm trying but I have a problem: when I navigate through the tabs FCKFaces text is lost...

            • 3. Re: rich:tab fckfaces js error
              juanignaciosl

              On the other hand, RichFaces documentation tells to embed tabPanel inside a form, not a form inside each tab. Which is the best option?

              • 4. Re: rich:tab fckfaces js error
                ilya_shaikovsky

                Both ways allowed. But if you used form inside tab instead of around the tabPanel - this forms will not be submitted on tab switching. You will be able to submit them only via nested controls.

                • 5. Re: rich:tab fckfaces js error
                  juanignaciosl

                  Ok, I had the form around tabPanel. But I can't manage fckfaces to work... When I put it into the tabs they stop working (clicking tabs does nothing). This is the log trace:

                  debug[14:01:44,381]: Have Event [object Object] with properties: target: [object HTMLTableCellElement], srcElement: undefined, type: click
                  debug[14:01:44,381]: NEW AJAX REQUEST !!! with form :nuevaConvocatoriaForm
                  debug[14:01:44,381]: Append text control nuevaConvocatoriaForm:titulo with value [] and value attribute []
                  debug[14:01:44,381]: Append select-one control nuevaConvocatoriaForm:estado with value [50] and value attribute [null]
                  debug[14:01:44,381]: Append text control nuevaConvocatoriaForm:fuente with value [] and value attribute []
                  debug[14:01:44,381]: Append text control nuevaConvocatoriaForm:tema with value [] and value attribute []
                  debug[14:01:44,381]: Append text control nuevaConvocatoriaForm:tipo with value [] and value attribute []
                  debug[14:01:44,381]: Append select-one control nuevaConvocatoriaForm:orgConvocante with value [50] and value attribute [null]
                  debug[14:01:44,381]: Append text control nuevaConvocatoriaForm:acronimo with value [] and value attribute []
                  debug[14:01:44,381]: Append text control nuevaConvocatoriaForm:plazoSolicitudes.day with value [] and value attribute [null]
                  debug[14:01:44,381]: Append select-one control nuevaConvocatoriaForm:plazoSolicitudes.month with value [-1] and value attribute [null]
                  debug[14:01:44,381]: Append text control nuevaConvocatoriaForm:plazoSolicitudes.year with value [] and value attribute [null]
                  debug[14:01:44,381]: Append text control nuevaConvocatoriaForm:envioDocumentos with value [] and value attribute []
                  debug[14:01:44,381]: Append file control nuevaConvocatoriaForm:ficheroConvocatoria with value [] and value attribute [null]
                  debug[14:01:44,381]: Append file control nuevaConvocatoriaForm:documentacionAsoc with value [] and value attribute [null]
                  debug[14:01:44,381]: Append text control nuevaConvocatoriaForm:palabrasClave with value [] and value attribute [null]
                  debug[14:01:44,381]: Append hidden control autoScroll with value [] and value attribute [null]
                  debug[14:01:44,396]: Append hidden control nuevaConvocatoriaForm_SUBMIT with value [1] and value attribute [1]
                  debug[14:01:44,396]: Append hidden control nuevaConvocatoriaForm:_link_hidden_ with value [] and value attribute []
                  debug[14:01:44,396]: Append hidden control nuevaConvocatoriaForm:_idcl with value [] and value attribute []
                  debug[14:01:44,396]: Append hidden control javax.faces.ViewState with value [rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAExcHQAJC9jb252b2NhdG9yaWFzL251ZXZhQ29udm9jYXRvcmlhLmpzcA==] and value attribute [rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAExcHQAJC9jb252b2NhdG9yaWFzL251ZXZhQ29udm9jYXRvcmlhLmpzcA==]
                  debug[14:01:44,396]: parameter nuevaConvocatoriaForm:pestanhaResumen with value nuevaConvocatoriaForm:pestanhaResumen
                  debug[14:01:44,396]: Start XmlHttpRequest
                  debug[14:01:44,396]: Reqest state : 1
                  debug[14:01:44,396]: QueryString: AJAXREQUEST=nuevaConvocatoriaForm%3A_idJsp0&nuevaConvocatoriaForm%3Atitulo=&nuevaConvocatoriaForm%3Aestado=50&nuevaConvocatoriaForm%3Afuente=&nuevaConvocatoriaForm%3Atema=&nuevaConvocatoriaForm%3Atipo=&nuevaConvocatoriaForm%3AorgConvocante=50&nuevaConvocatoriaForm%3Aacronimo=&nuevaConvocatoriaForm%3AplazoSolicitudes.day=&nuevaConvocatoriaForm%3AplazoSolicitudes.month=-1&nuevaConvocatoriaForm%3AplazoSolicitudes.year=&nuevaConvocatoriaForm%3AenvioDocumentos=&nuevaConvocatoriaForm%3AficheroConvocatoria=&nuevaConvocatoriaForm%3AdocumentacionAsoc=&nuevaConvocatoriaForm%3ApalabrasClave=&autoScroll=&nuevaConvocatoriaForm_SUBMIT=1&nuevaConvocatoriaForm%3A_link_hidden_=&nuevaConvocatoriaForm%3A_idcl=&javax.faces.ViewState=rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAExcHQAJC9jb252b2NhdG9yaWFzL251ZXZhQ29udm9jYXRvcmlhLmpzcA%3D%3D&nuevaConvocatoriaForm%3ApestanhaResumen=nuevaConvocatoriaForm%3ApestanhaResumen&
                  debug[14:01:44,396]: Reqest state : 1
                  debug[14:01:44,834]: Reqest state : 2
                  debug[14:01:44,834]: Reqest state : 3
                  debug[14:01:44,849]: Reqest state : 3
                  debug[14:01:44,849]: Reqest state : 3
                  debug[14:01:44,849]: Reqest state : 4
                  debug[14:01:44,849]: Reqest end with state 4
                  debug[14:01:44,849]: Response with content-type: text/xml;charset=UTF-8
                  debug[14:01:44,849]: Full response content: <?xml version="1.0"?> <html lang="es" xmlns="http://www.w3.org/1999/xhtml"><head><title></title><link type="text/css" rel="stylesheet" href="/gnomos/faces/a4j.res/css/tabPanel.xcss/DATA/eAFbJaehBAADeAET" /><script type="text/javascript" src="/gnomos/faces/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript"> </script><script type="text/javascript" src="/gnomos/faces/a4j.res/org.ajax4jsf.framework.resource.PrototypeScript"> </script><script type="text/javascript" src="/gnomos/faces/a4j.res/org.ajax4jsf.framework.ajax.ImageCacheScript"> </script><script type="text/javascript" src="/gnomos/faces/a4j.res//org/richfaces/renderkit/html/scripts/browser_info.js"> </script><script type="text/javascript" src="/gnomos/faces/a4j.res//org/ajax4jsf/renderkit/html/scripts/form.js"> </script><script type="text/javascript" src="/gnomos/faces/a4j.res/scripts/tabPanel.js"> </script></head><body><table border="0" cellpadding="0" cellspacing="0" class="rich-tabpanel" id="nuevaConvocatoriaForm:tabPanel" style="width:100%"><tbody><tr><td align="left"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="2" /></td><td id="nuevaConvocatoriaForm:tpPDatos_cell" style="height: 100%; vertical-align: bottom;" class="dr-tbpnl-tbcell-inact rich-tabhdr-cell-inactive"><table border="0" cellpadding="0" cellspacing="0" style="height : 100%; position : relative; z-index : 2" onclick="if (RichFaces.isTabActive('nuevaConvocatoriaForm:tpPDatos_lbl')) return false;A4J.AJAX.Submit('nuevaConvocatoriaForm:_idJsp0','nuevaConvocatoriaForm',event,{'parameters':{'nuevaConvocatoriaForm:tpPDatos':'nuevaConvocatoriaForm:tpPDatos'} ,'actionUrl':'/gnomos/convocatorias/nuevaConvocatoria.jsf'} ); return false; this.onclick = null;"><tbody><tr><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td><td class="dr-tbpnl-tbtopbrdr rich-tabhdr-side-cell"><table border="0" cellpadding="0" cellspacing="0" style="height: 100%; width: 100%;"><tbody><tr><td id="nuevaConvocatoriaForm:tpPDatos_lbl" onmouseover="RichFaces.overTab(this);" onmouseout="RichFaces.outTab(this);" class="dr-tbpnl-tb rich-tab-header dr-tbpnl-tb-inact rich-tab-inactive">Datos de la Convocatoria</td></tr></tbody></table></td><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td></tr></tbody></table></td><td><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" style="width: 1px" /></td><td id="nuevaConvocatoriaForm:pestanhaResumen_cell" style="height: 100%; vertical-align: bottom;" class="dr-tbpnl-tbcell-act rich-tabhdr-cell-active"><table border="0" cellpadding="0" cellspacing="0" style="height : 100%; position : relative; z-index : 2" onclick="if (RichFaces.isTabActive('nuevaConvocatoriaForm:pestanhaResumen_lbl')) return false;A4J.AJAX.Submit('nuevaConvocatoriaForm:_idJsp0','nuevaConvocatoriaForm',event,{'parameters':{'nuevaConvocatoriaForm:pestanhaResumen':'nuevaConvocatoriaForm:pestanhaResumen'} ,'actionUrl':'/gnomos/convocatorias/nuevaConvocatoria.jsf'} ); return false; this.onclick = null;"><tbody><tr><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td><td class="dr-tbpnl-tbtopbrdr rich-tabhdr-side-cell"><table border="0" cellpadding="0" cellspacing="0" style="height: 100%; width: 100%;"><tbody><tr><td id="nuevaConvocatoriaForm:pestanhaResumen_lbl" onmouseover="RichFaces.overTab(this);" onmouseout="RichFaces.outTab(this);" class="dr-tbpnl-tb rich-tab-header dr-tbpnl-tb-act rich-tab-active">Resumen</td></tr></tbody></table></td><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td></tr></tbody></table></td><td><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" style="width: 1px" /></td><td id="nuevaConvocatoriaForm:pestahaEnvio_cell" style="height: 100%; vertical-align: bottom;" class="dr-tbpnl-tbcell-inact rich-tabhdr-cell-inactive"><table border="0" cellpadding="0" cellspacing="0" style="height : 100%; position : relative; z-index : 2" onclick="if (RichFaces.isTabActive('nuevaConvocatoriaForm:pestahaEnvio_lbl')) return false;A4J.AJAX.Submit('nuevaConvocatoriaForm:_idJsp0','nuevaConvocatoriaForm',event,{'parameters':{'nuevaConvocatoriaForm:pestahaEnvio':'nuevaConvocatoriaForm:pestahaEnvio'} ,'actionUrl':'/gnomos/convocatorias/nuevaConvocatoria.jsf'} ); return false; this.onclick = null;"><tbody><tr><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td><td class="dr-tbpnl-tbtopbrdr rich-tabhdr-side-cell"><table border="0" cellpadding="0" cellspacing="0" style="height: 100%; width: 100%;"><tbody><tr><td id="nuevaConvocatoriaForm:pestahaEnvio_lbl" onmouseover="RichFaces.overTab(this);" onmouseout="RichFaces.outTab(this);" class="dr-tbpnl-tb rich-tab-header dr-tbpnl-tb-inact rich-tab-inactive">Envío</td></tr></tbody></table></td><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td></tr></tbody></table></td><td><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" style="width: 1px" /></td><td id="nuevaConvocatoriaForm:_idJsp27_cell" style="height: 100%; vertical-align: bottom;" class="dr-tbpnl-tbcell-inact rich-tabhdr-cell-inactive"><table border="0" cellpadding="0" cellspacing="0" style="height : 100%; position : relative; z-index : 2" onclick="if (RichFaces.isTabActive('nuevaConvocatoriaForm:_idJsp27_lbl')) return false;A4J.AJAX.Submit('nuevaConvocatoriaForm:_idJsp0','nuevaConvocatoriaForm',event,{'parameters':{'nuevaConvocatoriaForm:_idJsp27':'nuevaConvocatoriaForm:_idJsp27'} ,'actionUrl':'/gnomos/convocatorias/nuevaConvocatoria.jsf'} ); return false; this.onclick = null;"><tbody><tr><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td><td class="dr-tbpnl-tbtopbrdr rich-tabhdr-side-cell"><table border="0" cellpadding="0" cellspacing="0" style="height: 100%; width: 100%;"><tbody><tr><td id="nuevaConvocatoriaForm:_idJsp27_lbl" onmouseover="RichFaces.overTab(this);" onmouseout="RichFaces.outTab(this);" class="dr-tbpnl-tb rich-tab-header dr-tbpnl-tb-inact rich-tab-inactive">Enlaces</td></tr></tbody></table></td><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td></tr></tbody></table></td><td><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" style="width: 1px" /></td><td id="nuevaConvocatoriaForm:_idJsp28_cell" style="height: 100%; vertical-align: bottom;" class="dr-tbpnl-tbcell-inact rich-tabhdr-cell-inactive"><table border="0" cellpadding="0" cellspacing="0" style="height : 100%; position : relative; z-index : 2" onclick="if (RichFaces.isTabActive('nuevaConvocatoriaForm:_idJsp28_lbl')) return false;A4J.AJAX.Submit('nuevaConvocatoriaForm:_idJsp0','nuevaConvocatoriaForm',event,{'parameters':{'nuevaConvocatoriaForm:_idJsp28':'nuevaConvocatoriaForm:_idJsp28'} ,'actionUrl':'/gnomos/convocatorias/nuevaConvocatoria.jsf'} ); return false; this.onclick = null;"><tbody><tr><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td><td class="dr-tbpnl-tbtopbrdr rich-tabhdr-side-cell"><table border="0" cellpadding="0" cellspacing="0" style="height: 100%; width: 100%;"><tbody><tr><td id="nuevaConvocatoriaForm:_idJsp28_lbl" onmouseover="RichFaces.overTab(this);" onmouseout="RichFaces.outTab(this);" class="dr-tbpnl-tb rich-tab-header dr-tbpnl-tb-inact rich-tab-inactive">Proyectos Asociados e Interesados</td></tr></tbody></table></td><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td></tr></tbody></table></td><td><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" style="width: 1px" /></td><td id="nuevaConvocatoriaForm:_idJsp29_cell" style="height: 100%; vertical-align: bottom;" class="dr-tbpnl-tbcell-inact rich-tabhdr-cell-inactive"><table border="0" cellpadding="0" cellspacing="0" style="height : 100%; position : relative; z-index : 2" onclick="if (RichFaces.isTabActive('nuevaConvocatoriaForm:_idJsp29_lbl')) return false;A4J.AJAX.Submit('nuevaConvocatoriaForm:_idJsp0','nuevaConvocatoriaForm',event,{'parameters':{'nuevaConvocatoriaForm:_idJsp29':'nuevaConvocatoriaForm:_idJsp29'} ,'actionUrl':'/gnomos/convocatorias/nuevaConvocatoria.jsf'} ); return false; this.onclick = null;"><tbody><tr><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td><td class="dr-tbpnl-tbtopbrdr rich-tabhdr-side-cell"><table border="0" cellpadding="0" cellspacing="0" style="height: 100%; width: 100%;"><tbody><tr><td id="nuevaConvocatoriaForm:_idJsp29_lbl" onmouseover="RichFaces.overTab(this);" onmouseout="RichFaces.outTab(this);" class="dr-tbpnl-tb rich-tab-header dr-tbpnl-tb-inact rich-tab-inactive">Historial de Tramitación</td></tr></tbody></table></td><td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td></tr></tbody></table></td><td><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" style="width: 1px" /></td><td><img border="0" height="1" src="/gnomos/faces/a4j.res/images/spacer.gif" width="1" /></td></tr></tbody></table></td></tr><tr><td height="100%" id="nuevaConvocatoriaForm:pestanhaResumen" style="position: relative;"><table border="0" cellpadding="10" cellspacing="0" class="dr-tbpnl-cntnt-pstn rich-tabpanel-content-position" style="position : relative; z-index: 1;" width="100%"><tbody><tr><td class="dr-tbpnl-cntnt rich-tabpanel-content" style=";"> </td></tr></tbody></table></td></tr></tbody></table><meta name="Ajax-Update-Ids" content="nuevaConvocatoriaForm:tabPanel" /><span id="ajax-update-ids"><input type="hidden" name="jsf_sequence" value="2" /><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAEycHQAJC9jb252b2NhdG9yaWFzL251ZXZhQ29udm9jYXRvcmlhLmpzcA==" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
                  debug[14:01:44,849]: Update page by list of rendered areas from response nuevaConvocatoriaForm:tabPanel
                  debug[14:01:44,849]: search for elements by name 'script' in element #document
                  debug[14:01:44,849]: getElementsByTagName found 6
                  debug[14:01:44,865]: <script> in response with src=/gnomos/faces/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript
                  debug[14:01:44,865]: Such element exist in document
                  debug[14:01:44,865]: <script> in response with src=/gnomos/faces/a4j.res/org.ajax4jsf.framework.resource.PrototypeScript
                  debug[14:01:44,865]: Such element exist in document
                  debug[14:01:44,865]: <script> in response with src=/gnomos/faces/a4j.res/org.ajax4jsf.framework.ajax.ImageCacheScript
                  debug[14:01:44,865]: Such element exist in document
                  debug[14:01:44,865]: <script> in response with src=/gnomos/faces/a4j.res//org/richfaces/renderkit/html/scripts/browser_info.js
                  debug[14:01:44,865]: Such element exist in document
                  debug[14:01:44,865]: <script> in response with src=/gnomos/faces/a4j.res//org/ajax4jsf/renderkit/html/scripts/form.js
                  debug[14:01:44,865]: Such element exist in document
                  debug[14:01:44,865]: <script> in response with src=/gnomos/faces/a4j.res/scripts/tabPanel.js
                  debug[14:01:44,865]: Such element exist in document
                  debug[14:01:44,865]: search for elements by name 'link' in element #document
                  debug[14:01:44,881]: getElementsByTagName found 1
                  debug[14:01:44,881]: <link> in response with src=/gnomos/faces/a4j.res/css/tabPanel.xcss/DATA/eAFbJaehBAADeAET
                  


                  (Please excuse the width of the post, but I prefer sending the whole log trace)

                  • 6. Re: rich:tab fckfaces js error
                    fabmars

                    From my experience, Tabs in RichFaces 3.1.x have a strange Ajax behavior. They happen to trigger the whoel form validation even with ajaxSingle's for example.
                    There are other connex issues to this in the Jira, if I rememebr well.

                    • 7. Re: rich:tab fckfaces js error
                      fabmars

                      Beware, you might also encounter this: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=717
                      I was about to complain about that issue when I saw one of the RF guys had already done the same a few days before :)