首页 > 解决方案 > 如何在 Pentaho 仪表板上插入有条件的图像?

问题描述

我知道如何使用add imageavaible onLayout Panel或使用 HTML 插入图像。

但是我想提出一个条件:如果图像不可用或不存在,则我要显示一个默认图像。

所以我想我需要用js函数来做。最好的方法是什么?

标签: pentahopentaho-cde

解决方案


您可以为此使用 html 中的图像标签。

 <img id="img" src="SomeImage.jpg" onerror="this.onerror=null; this.src=default.png" alt="" width="100" height="120">

推荐阅读