You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Oracle Apex地图区域自定义按钮触发Dynamic Action失败:无对应动作

Oracle Apex 23.2 地图信息窗按钮触发动态动作的问题解决

问题场景

在Oracle Apex 23.2的地图区域中,为自定义信息窗口内的按钮配置了触发Dynamic Action的逻辑,该逻辑在卡片区域可正常运行,但在地图区域中执行时,浏览器控制台报错:

"No such action, 'DRIVE_TO_DESTINATION'."

初始实现及问题

最初使用的按钮HTML代码如下:

<button type="button" class="t-Button t-Button--tiny t-Button--success t-Button--stretch fa fa-location-arrow" data-action="DRIVE_TO_DESTINATION" 
data-appointment_id=&APPOINTMENT_ID. data-latitudine=&LATITUDINE. data-longitudine=&LONGITUDINE. >
    Drive
</button>

在地图区域中,Dynamic Action未被正确识别注册,导致上述报错。

解决方案

采用Apex 22.1新增的JS API注册自定义动作,具体步骤如下:

  1. 在页面加载执行部分添加JS代码,注册新动作:
apex.jQuery(window).on('theme42ready', () => {
  apex.actions.add([
    {
      name: 'launch-google-nav',
      Label: 'Launch google maps',
      action: (event, element, args) => {
        $.event.trigger("btn_drive_clicked");

        return true;
      },
    },
  ]);
});
  1. 修改按钮HTML为链接格式,通过action触发注册的动作:
<a href="#action$launch-google-nav?latitudine=&LATITUDINE."  class="btn-drive t-Button t-Button--tiny t-Button--success t-Button--stretch fa fa-location-arrow" type="button" 
>Naviga</a>

完成上述修改后,Dynamic Action可正常触发运行。

内容的提问来源于stack exchange,提问作者execcr

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.20 05:12:17