5 Replies Latest reply on Oct 22, 2013 10:57 AM by saini.sushant

    Issue with Richfaces 4.3.2 Tooltip listener

    saini.sushant

      Hi,

      I am trying to upgrade from Richfaces 3.3.3 to 4.3.2. I have an issue where the tootip loads but without data. bascially I had an listener attached to tooltip which is suppose to load the data but that listener is not being invoked after migration. I need a listener on the server side as I load the tool tip data only when somebody hovers over the comoponent.

       

      here is my tooltip code.

       

      <a4j:outputPanel id="tooltippanel">
          <h:graphicImage id="bldlocQuickPeek" url="images/preview.gif" rendered="#{not empty arr.locationName}" alt="Location Quick Peek"></h:graphicImage>
          <rich:tooltip  target="bldlocQuickPeek"  listener="#{buildingSearchBackBean.onLocationHover}"  mode="ajax"
                         verticalOffset="-100" horizontalOffset="5">
              <div class="quickpeek-top"><h1> Location Quick Peek</h1></div>
              <div class="quickpeek-bg">
                  <table cellpadding="0" cellspacing="0">
                      <tr>
                          <td><h:outputLabel styleClass="qplabel" value="Address"/></td>
                          <td><h:outputText styleClass="qpfield smalltext" value="#{buildingSearchBackBean.locQPAddress}"/></td>
                      </tr>
                      <tr>
                          <td><div class="qpline"></div></td>
                          <td><div class="qpline"></div></td>
                      </tr>
                      <tr>
                          <td><h:outputLabel styleClass="qplabel" value="City"/></td>
                          <td><h:outputText styleClass="qpfield smalltext" value="#{buildingSearchBackBean.locQPCity}"/></td>
                      </tr>
                      <tr>
                          <td><div class="qpline"></div></td>
                          <td><div class="qpline"></div></td>
                      </tr>
                      <tr>
                          <td><h:outputLabel styleClass="qplabel" value="Field Office"/></td>
                          <td><h:outputText styleClass="qpfield smalltext" value="#{buildingSearchBackBean.locQPFieldOffice}"/></td>
                      </tr>
                      <tr>
                          <td><div class="qpline"></div></td>
                          <td><div class="qpline"></div></td>
                      </tr>
                      <tr>
                          <td><h:outputLabel styleClass="qplabel" value="Occup Right"/></td>
                          <td><h:outputText styleClass="qpfield smalltext" value="#{buildingSearchBackBean.locQPOccupRight}"/></td>
                      </tr>
                      <tr>
                          <td><div class="qpline"></div></td>
                          <td><div class="qpline"></div></td>
                      </tr>
                  </table>
              </div>
              <div class="quickpeek-bottom"></div>
              <a4j:ajax event="mouseover" requestDelay="5000"></a4j:ajax>
          </rich:tooltip>
      </a4j:outputPanel>
      

       

      and here is the listener on the back on the server

       

      public void onLocationHover(ActionEvent e) {
        // getLogger().debug("inside hover event");
        BuildingSearchResultsDTO srt = (BuildingSearchResultsDTO) this.htmlDataTable.getRowData();
        // getLogger().debug("loc code = "+srt.getLocationCode());
        BldQuickPeekDTO bldQuickPeekDTO = this.getBuildingSearchBusinessDelegate().getBldQuickPeek(srt.getLocationCode());
        setLocQPAddress(bldQuickPeekDTO.getAddress());
        setLocQPCity(bldQuickPeekDTO.getCity());
        setLocQPFieldOffice(bldQuickPeekDTO.getFieldOffice());
        setLocQPOccupRight(bldQuickPeekDTO.getOccupRight());
      }
      
        • 1. Re: Issue with Richfaces 4.3.2 Tooltip listener
          bleathem

          Does your browser's developer tools indicate a request was made to the server?  Any error messages in your browser console? in your server log?

           

          Follow these instructions for debugging your RichFaces applications:

          https://gist.github.com/lfryc/6123495

          • 2. Re: Issue with Richfaces 4.3.2 Tooltip listener
            saini.sushant

            Hi Brain,

            Quick question. Is listener still a valid attribute for tooltip in Richfaces 4.3.2? If not how can I invoke an  listener on server side to intialize the data for tool tip?

            • 3. Re: Issue with Richfaces 4.3.2 Tooltip listener
              bleathem

              Not according to the VDL doc:

              http://docs.jboss.org/richfaces/latest_4_X/vdldoc/rich/tooltip.html

               

              In JSF 2 you can achieve this by nesting an ajax behaviour in the component, and triggering it off of one of the tooltip events.

              • 4. Re: Issue with Richfaces 4.3.2 Tooltip listener
                liuliu

                What I found is the tooltip works like popup, RF place them in the view root. so your tooltip is not in a form, and tooltip has not domattachement attribute. so if you want invoke some action, you need put your tooltip outer of the form, and give it another form.

                • 5. Re: Issue with Richfaces 4.3.2 Tooltip listener
                  saini.sushant

                  After spending 3 days I have been able to get it to work. here is my solution.

                   

                  <h:graphicImage id="bldlocQuickPeek" url="images/preview.gif" rendered="#{not empty arr.locationName}" alt="Location Quick Peek">

                              <a4j:ajax event="click" listener="#{buildingSearchBackBean.onLocationHover(arr.locationCode)}">

                              </a4j:ajax>

                              </h:graphicImage>

                            

                    <rich:tooltip  target="bldlocQuickPeek"  listener="#{buildingSearchBackBean.onLocationHover}"  mode="ajax" showEvent="click"

                    verticalOffset="-5" horizontalOffset="5">               

                                   <div class="quickpeek-top"><h1> Location Quick Peek</h1></div>

                    <div class="quickpeek-bg">

                                   <table cellpadding="0" cellspacing="0">

                                     <tr>

                                      <td><h:outputLabel styleClass="qplabel" value="Address"/></td>

                                       <td><h:outputText styleClass="qpfield smalltext" value="#{buildingSearchBackBean.locQPAddress}"/></td>                   

                                     </tr>

                                     <tr>

                    <td><div class="qpline"></div></td>

                    <td><div class="qpline"></div></td>

                     </tr>

                                     <tr>

                                      <td><h:outputLabel styleClass="qplabel" value="City"/></td>

                                       <td><h:outputText styleClass="qpfield smalltext" value="#{buildingSearchBackBean.locQPCity}"/></td>                   

                                     </tr>

                                     <tr>

                    <td><div class="qpline"></div></td>

                    <td><div class="qpline"></div></td>

                     </tr>

                                     <tr>

                                      <td><h:outputLabel styleClass="qplabel" value="Field Office"/></td>

                                       <td><h:outputText styleClass="qpfield smalltext" value="#{buildingSearchBackBean.locQPFieldOffice}"/></td>                   

                                     </tr>

                                     <tr>

                    <td><div class="qpline"></div></td>

                    <td><div class="qpline"></div></td>

                     </tr>

                                     <tr>

                                      <td><h:outputLabel styleClass="qplabel" value="Occup Right"/></td>

                                       <td><h:outputText styleClass="qpfield smalltext" value="#{buildingSearchBackBean.locQPOccupRight}"/></td>                   

                                     </tr>

                                     <tr>

                    <td><div class="qpline"></div></td>

                    <td><div class="qpline"></div></td>

                     </tr>

                                   </table>

                                   </div>

                                   <div class="quickpeek-bottom"></div>

                   

                   

                    </rich:tooltip>

                   

                  The code on server side is

                   

                   

                  public void onLocationHover(String e) {

                    // getLogger().debug("inside hover event");

                    BuildingSearchResultsDTO srt = (BuildingSearchResultsDTO) this.htmlDataTable

                    .getRowData();

                    // getLogger().debug("loc code = "+srt.getLocationCode());

                    BldQuickPeekDTO bldQuickPeekDTO = this.getBuildingSearchBusinessDelegate()

                    .getBldQuickPeek(e);

                    setLocQPAddress(bldQuickPeekDTO.getAddress());

                    setLocQPCity(bldQuickPeekDTO.getCity());

                    setLocQPFieldOffice(bldQuickPeekDTO.getFieldOffice());

                    setLocQPOccupRight(bldQuickPeekDTO.getOccupRight());

                   

                   

                    }