7 Replies Latest reply on Dec 1, 2014 2:54 AM by Kishi kiran

    Tooltip is not displaed on mouseover of image through programatically

    Kishi kiran Newbie

      Hello All, I have a problem, trying to use a Tooltip created programtically to show on certain image, I am using Richfaces 4.2.1.Final,  javaEE6, Facelets 2.0

      Here is the java code snippet where I create the Tooltip:

      private UIComponent createLocationContainer(){
      UIComponent locationContainer = this.htmlGenerator.createContainer("locationContainer");
      
      locationContainer.getChildren().add(
      this.htmlGenerator.ImageTag(icon_path/sampleImage.png", ""));
      
      UITooltip tooltip = new UITooltip();
      tooltip.setFollowMouse(false);
      tooltip.setHorizontalOffset(0);
      tooltip.setVerticalOffset(0);
      tooltip.setStyleClass("infoPopup bigPopup");
        tooltip.getChildren().add(
                      this.htmlGenerator.createTextLine("sample Text”, "heading"));
      
      locationContainer.getChildren().add(tooltip);
      
      return locationContainer;
      }
      public UIComponent createContainer(String cssClass) {
              HtmlPanelGroup hop = new HtmlPanelGroup();
              hop.setStyleClass(cssClass);
              hop.setLayout("block");
              return hop;
          }
      
      

      Here the ‘locationContainer’ is attached to a child of other HtmlPanelgroup,

      The problem here is : the tool tip is created to the htmlpanel group as a chiled, but when ever I mouseover on the image tooltip is not being displayed.

      Here is the console output:

       

      222.png

       

      From this console also I can see that the tool tip is being added to the image, and I have observed that the css classes display: none for tooltip ,

      Can someone help me out, is there any mouse over functionality needs to be added to the tool tip through programmatically?

      Like It tooltip to be displayed whenever mouse over on the image , it is not happening.

       

      Thank in Advance.