2 Replies Latest reply on Sep 22, 2007 3:26 PM by Maksim Kaszynski

    Javascript exceptions using toolTip

    Adrian Mitev Master

      Hi! I have the following code:

      <h:form style="display: inline;">
       <table align="center">
       <tr>
       <td colspan="3"><h:messages layout="table" globalOnly="true"
       styleClass="errorMessage" id="globalMessages" /></td>
       </tr>
       <tr>
       <td>#{userMsg.user}</td>
       <td><h:inputText id="userName" value="#{user.userName}"
       required="true">
       <rich:toolTip value="????? 3 ? 16 ???????" />
       <f:validateLength minimum="3" maximum="16" />
       </h:inputText></td>
       <td><h:message styleClass="errorMessage" for="userName" /></td>
       </tr>
      .....
      


      On mouseover and on mouseout on the input filed the tooltip is shown/hidden but javascript exception is thrown


      [Exception... "'Permission denied to get property HTMLDivElement.parentNode' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]
      
      Line 0


      This is the rendered html

      <td>
      <!-- h:styles>
       /org/richfaces/renderkit/html/css/tooltip.xcss
       </h:styles>
       <h:scripts>
       new org.ajax4jsf.framework.resource.PrototypeScript(),
       new org.ajax4jsf.framework.ajax.AjaxScript(),
       /org/richfaces/renderkit/html/scripts/utils.js,
       /org/richfaces/renderkit/html/scripts/tooltip.js
       </h:scripts--><span class="dr-rich-tool-tip rich-tool-tip" id="j_id45:j_id48" style="position: absolute; display : none;z-index:99;">
      <span id="j_id45:j_id48content">????? 3 ? 16 ???????</span><span id="j_id45:j_id48script" style="display:none">
      <script type="text/javascript" id="scriptj_id45:j_id48">//<![CDATA[
      new ToolTip({'onhide':'','event':'mouseover','onshow':'','delay':0,'oncomplete':''} ,"j_id45:j_id48","j_id45:userName","client",false,"bottom-right",false,10,10,
      "A4J.AJAX.Submit('_viewRoot','j_id45',event,ajaxOptions)",
      {'parameters':{'j_id45:j_id48':'j_id45:j_id48'} ,'actionUrl':'/Bts/pages/user/edit.jsf','oncomplete':function(request,event,data)
      {;Richfaces.tooltips['j_id45:userName'].toolTip = $('j_id45:j_id48');;Richfaces.tooltips['j_id45:userName'].toolTipContent = $('j_id45:j_id48content');;Richfaces.tooltips['j_id45:userName'].displayDiv();},'control':this,
      'onbeforedomupdate':function(request,event,data){;Richfaces.tooltips['j_id45:userName'].toolTip.style.display = 'none';}} );;
      
      //]]>
      
      </script></span></span><!-- f:call name="utils.encodeEndFormIfNessesary"/--><input id="j_id45:userName" type="text" name="j_id45:userName" />
      </td>
      


      Should the cdk tags appear in the rendered html - like h:scripts, etc

      P.S. There are errors but the tooltip is still working.