Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TooltipBaseRenderer.js: 404 - NOT FOUND

Tags:

sapui5

I extended sap.ui.core.TooltipBase with mouseover event handling which is attached to some sap.ui.core.Icon in the ChartContainer:

 sap.ui.define(function () {
    "use strict";
    return sap.ui.core.TooltipBase.extend("dvd.rl.component.ChartContainer.parts.TooltipBase.TooltipBase", { 
            metadata: {
                events: {
                    "onmouseover" : {}  
                }
            },
            oView: null,

            setView : function(view){
                this.oView = view;
            },

//          the hover event handler, it is called when the Button is hovered - no event registration required
            onmouseover : function() {}, 
});

Everythink works well, but when I click on the Icon in the ChartContainer I got this error from the TooltipBaseRenderer.js (This happens before handling of press event.):

enter image description here

In the TooltipBaseRenderer.js it is this line:

enter image description here

I have no idea what is going on there. If you will have I will be happy to hear it.

This is how I added TooltipBase to sap.ui.core.Icon:

//          Add custom Icon for filter
            var oFilterIcon = new  sap.ui.core.Icon("filterButton", {       
                tooltip     : "{i18n>filter}",
                src         : "sap-icon://filter",
                press       : [this.onHandleLocalFilterOpen,this]
            });
//          Add Icon to chart component
            oChartContainer.addCustomIcon(oFilterIcon); 

            var oTooltipBase = new TooltipBase();
//          set new TooltipBase to Icon                 
            oFilterIcon.setTooltip(oTooltipBase);

EDITED 12:15 100117:

When I use renderer in the TooltipBase.extend:

//just inherit the renderer as it is
renderer: {}, 

I got this error:

enter image description here

So I removed renderer, and TooltipBase works when I hover over Icon. The problem is when I click on the Icon as I described higher.

like image 785
Jaro Avatar asked Sep 13 '26 05:09

Jaro


1 Answers

Here is a working sample custom tooltip extended from sap/ui/core/TooltipBase.

Make sure that your renderer has the render method. Otherwise UI5 will look for it at the parent. Also TooltipBase already handles the mouse events. No need to handle them in your extension.


This is what happened:

  1. Your renderer had no render function (renderer: { }).
  2. UI5 looks for the render in the parent renderer (sap/ui/core/TooltipBaseRenderer).
  3. There is no TooltipBaseRenderer.js since TooltipBase is an abstract control. Abstract controls have no renderer (renderer: null // not undefined in their definition).

Usually, UI5 bypasses fetching the renderer for abstract controls but the TooltipBase was unfortunately missing the renderer: null. So UI5 assumed that there must be a file named TooltipBaseRenderer.js which resulted in the 404 error. As of UI5 1.82, the TooltipBase has renderer: null, so the issue is no longer reproducible.

like image 166
Boghyon Hoffmann Avatar answered Sep 15 '26 11:09

Boghyon Hoffmann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!