使用内置搜索过滤器时,交互式报告中的 Apex 按钮会中断
Apex buttons in Interactive Reports break when built-in search filter used
在 Apex 5.0.2 中。我在交互式报告中创建了一个复制到剪贴板的功能。用户可以通过单击设置在列中并在每一行中重复的按钮来复制隐藏列的值(见下图)。
使用执行以下操作的 HTML 表达式编辑复制列:
<button class="copytoclipboard
t-Button
t-Button--noLabel
t-Button--icon
t-Button--stretch" customid="#COPY#" type="button">
<span class="t-Icon fa fa-copy" aria-hidden="true">
</span>
</button>
我对事件 'click'、jQuery 选择器 .copytoclipboard 的动态操作有 2 个真实操作。 1 通过从该行获取 customid 来设置页面项目 (text_field) 的值:
this.triggeringElement.getAttribute("customid")
然后第二个将这个值复制到剪贴板。
这工作正常,当我检查按钮元素时,我看到正确的 HTML 输出,具有正确的值。但是,一旦我在交互式报告中使用内置的搜索过滤器,我的按钮就会中断并且单击此按钮不会再触发我的动态操作,但是,检查元素仍然 returns 预期 HTML输出。
有人可以解释为什么会发生这种情况,以及如何避免这种情况?
提前致谢。
我找到了解决方案。我必须将动态操作的事件范围设置为动态,默认情况下设置为静态。使用内置页面过滤器对报告进行 PPR,因此当静态时,事件处理程序不再绑定到触发元素。
Static (default) - Binds the event handler to the triggering elements
for the lifetime of the current page, but will no longer be bound if
the triggering elements are updated via Partial Page Refresh (PPR).
Dynamic - Binds the event handler to the triggering elements for the
lifetime of the current page, including any triggering elements that
are recreated via Partial Page Refresh (PPR).
Once - Binds the event
handler to the triggering elements for a once only event.
在 Apex 5.0.2 中。我在交互式报告中创建了一个复制到剪贴板的功能。用户可以通过单击设置在列中并在每一行中重复的按钮来复制隐藏列的值(见下图)。
使用执行以下操作的 HTML 表达式编辑复制列:
<button class="copytoclipboard
t-Button
t-Button--noLabel
t-Button--icon
t-Button--stretch" customid="#COPY#" type="button">
<span class="t-Icon fa fa-copy" aria-hidden="true">
</span>
</button>
我对事件 'click'、jQuery 选择器 .copytoclipboard 的动态操作有 2 个真实操作。 1 通过从该行获取 customid 来设置页面项目 (text_field) 的值:
this.triggeringElement.getAttribute("customid")
然后第二个将这个值复制到剪贴板。
这工作正常,当我检查按钮元素时,我看到正确的 HTML 输出,具有正确的值。但是,一旦我在交互式报告中使用内置的搜索过滤器,我的按钮就会中断并且单击此按钮不会再触发我的动态操作,但是,检查元素仍然 returns 预期 HTML输出。
有人可以解释为什么会发生这种情况,以及如何避免这种情况?
提前致谢。
我找到了解决方案。我必须将动态操作的事件范围设置为动态,默认情况下设置为静态。使用内置页面过滤器对报告进行 PPR,因此当静态时,事件处理程序不再绑定到触发元素。
Static (default) - Binds the event handler to the triggering elements for the lifetime of the current page, but will no longer be bound if the triggering elements are updated via Partial Page Refresh (PPR).
Dynamic - Binds the event handler to the triggering elements for the lifetime of the current page, including any triggering elements that are recreated via Partial Page Refresh (PPR).
Once - Binds the event handler to the triggering elements for a once only event.