5 Replies Latest reply on Oct 10, 2008 5:32 PM by sergeysmirnov

    javascript errors with context menu component

      I have a context menu with different options and while I move the mouse over the items I get a lot of JS errors that I were not getting previously:

      resetMedia()(Document index.jsp, "link")skinning.js (line 3)
      f()()skinning.js (line 4)
      [Break on this error] if (RichFaces.Menu�isWithin(event, this)...899302_47:icon').className='dr-menu-icon



      $("menu:j_id_jsp_1562899\uFFFD02_51") is null
      onmouseover(mouseover clientX=216, clientY=100)9M3m24lf...pHg%3D%3D (line 6)
      [Break on this error] $("menu:j_id_jsp_1562899\uFFFD02_52").style.cssText = "; ; ;";


      illegal character
      [Break on this error] if (RichFaces.Menu.isWithin(eve�t, this)...icon').className='dr-menu-icon dr-menu-i


      $("\uFFFDrojectMenuForm:compilePackage") is null
      onmouseover(mouseover clientX=186, clientY=59)pxKtHRJs...Rxw%3D%3D (line 6)
      [Break on this error] $("\uFFFDrojectMenuForm:compilePackage").style.cssText = "; ; ;";


      Any idea why? Also what is the best practice with context menu to put them in another form outside the one that is calling them or inside the same one?

      Thanks

        • 1. Re: javascript errors with context menu component
          ilya_shaikovsky

          please tell us more about your environment (RF, JSF), browser and provide page snippet.

          • 2. Re: javascript errors with context menu component

            Same error for me. I've got a contextmenu on a treenode.
            Error happen only when show contextmenu on first level of tree.

            RF3.2.2
            JSF RI 1.2
            verified with IE7, FF3.0


            <h:form id="form" >
            
            <rich:tree binding="#{treeModelBean.treeReq}" requestDelay="50" eventsQueue="evTree" ignoreDupResponses="true" id="id_tree" adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client" ajaxSubmitSelection="true" >
             <rich:treeNodesAdaptor id="request" nodes="#{treeModelBean.requests}" var="req">
             <rich:treeNode nodeSelectListener="#{treeModelBean.processRic}" reRender="pnl_container,pnl_btn" iconLeaf="/resources/img/icons/16/health-care-shield-16x16.png" icon="/resources/img/icons/16/health-care-shield-16x16.png" >
             <h:outputLabel id="reqst" style="#{req.style}" value="Richiesta: #{req.id} - #{req.data}" />
             <rich:contextMenu id="menu_req" event="oncontextmenu" attached="true" attachTo="reqst" >
             <rich:menuItem rendered="#{req.canDelete}" oncomplete="Richfaces.showModalPanel('popupEditRequest');" submitMode="ajax" value="Modifica Richiesta" action="#{treeModelBean.editSavedReq}" reRender="popupEditRequest,pnl_tree,pnl_btn,pnl_container" />
             <rich:menuItem value="Stampa Ticket" action="#{treeModelBean.buildReport}" submitMode="ajax" oncomplete="Richfaces.showModalPanel('popupPdf');" reRender="popupPdf" />
             </rich:contextMenu>
             </rich:treeNode>
             <rich:treeNodesAdaptor id="impegn" var="imp" nodes="#{req.impegnList}">
             <rich:treeNode nodeSelectListener="#{treeModelBean.processImp}" reRender="pnl_container" iconLeaf="/resources/img/icons/16/Medical-invoice-information-16x16.png" icon="/resources/img/icons/16/Medical-invoice-information-16x16.png" >
             <h:outputLabel id="impm" style="#{imp.style}" value="Imp: #{imp.impegnativa1} #{imp.impegnativa2}" />
             <rich:contextMenu submitMode="server" event="oncontextmenu" rendered="#{treeModelBean.newRequest}" attached="true" attachTo="impm" >
             <rich:menuItem value="Modifica Impegnativa" rendered="#{!(imp.proseguimento>0)}" oncomplete="Richfaces.showModalPanel('popupEditImpegnativa');" action="#{treeModelBean.prepareEditImpegnativa}" submitMode="ajax" reRender="popupEditImpegnativa" />
             <rich:menuItem value="Elimina Impegnativa" oncomplete="Richfaces.showModalPanel('confirmDelImp');" action="#{treeModelBean.prepareDelImp}" submitMode="ajax" reRender="confirmDelImp" />
             </rich:contextMenu>
             </rich:treeNode>
             <rich:treeNodesAdaptor id="exam" var="ex" nodes="#{imp.examList}">
             <rich:treeNode nodeSelectListener="#{treeModelBean.processEx}" oncomplete="javascript:Richfaces.showModalPanel('popupNewExam');" reRender="pnl_container,doc1,popupNewExam" iconLeaf="/resources/img/icons/16/blood-16x16.png" icon="/resources/img/icons/16/blood-16x16.png" >
             <h:outputLabel id="exm" style="#{ex.style}" value="Esame: #{ex.id}" />
             <h:outputLabel rendered="#{ex.numRepetition > 1}" id="exm2" style="#{ex.style}" value=" (#{ex.numRepetition})" />
             <rich:contextMenu submitMode="server" rendered="#{treeModelBean.newRequest}" event="oncontextmenu" attached="true" attachTo="exm" >
             <rich:menuItem reRender="popupNewExam" oncomplete="javascript:Richfaces.showModalPanel('popupNewExam');" submitMode="ajax" value="Modifica Esame" action="#{treeModelBean.prepareEditExam}" />
             <rich:menuItem reRender="confirmDelExam" oncomplete="javascript:Richfaces.showModalPanel('confirmDelExam');" submitMode="ajax" value="Elimina Esame" />
             </rich:contextMenu>
             </rich:treeNode>
             </rich:treeNodesAdaptor>
             </rich:treeNodesAdaptor>
             </rich:treeNodesAdaptor>
            </rich:tree>
            
            </h:form>
            



            ERROR "Illegal character"

            3_2_2.GAorg.ajax4jsf.javascript.AjaxScript line 101

            Thanks to all



            • 3. Re: javascript errors with context menu component

              I get this error randomly and it is usually fixed by restarting Tomcat, I don't know why but sometimes happens and others it doesnt.

              • 4. Re: javascript errors with context menu component

                 

                "kpolice" wrote:
                I get this error randomly and it is usually fixed by restarting Tomcat, I don't know why but sometimes happens and others it doesnt.


                It seems fixed migrating to mojarra 1.2_09 (I've used 1.2_08).