将侦听器添加到页面刷新事件

时间:2016-11-08 08:56:14

标签: events primefaces

我有一个需要在刷新页面后发生的操作

(不一定按F5,但只要刷新页面)。

如何添加此类事件侦听器?

1 个答案:

答案 0 :(得分:0)

我用这个:

<h:form>
   <p:remoteCommand name="update_page" process="@this" update="form" actionListener="#{myView.myAction}" />
.
.
.
.
</h:form>
<script>
  $(document).ready(function() {
    update_page();
  }
 </script>

加载或刷新页面运行 RemoteCommand

相关问题