pentaho - 如何在 Pentaho 仪表板上插入有条件的图像?
问题描述
我知道如何使用add image
avaible onLayout Panel
或使用 HTML 插入图像。
但是我想提出一个条件:如果图像不可用或不存在,则我要显示一个默认图像。
所以我想我需要用js函数来做。最好的方法是什么?
解决方案
您可以为此使用 html 中的图像标签。
<img id="img" src="SomeImage.jpg" onerror="this.onerror=null; this.src=default.png" alt="" width="100" height="120">
推荐阅读
- rust - 是什么使用 crate::body::Body; 意思是?
- linux-kernel - 如何让 Linux conntrack 单独处理 ip 片段?
- ios - 查询 mongo 数据库以获取唯一 ID 时,领域抛出谓词异常
- tensorflow - TensorFlow 2 量化感知训练 (QAT) 与 tf.GradientTape
- java - 请求应用兼容活动时提供地图活动的 Android 参数不匹配
- arrays - Mongo 查询 - 推送唯一项目并保留数组中的顺序
- javascript - VSCode:Webview扩展:js和ts共享数据结构定义
- python - Python网页抓取:来自谷歌搜索结果的网站
- html - exitBeforeEnter 没有按预期工作 - 页面转换出现问题
- apache-nifi - StandardRestrictedSSLContextService - 作为参数的 TrustStore 密码