Primefaces tabView:未发出 tabChange 事件
我使用 Primefaces tabView 能够在之间切换选项卡。当用户切换到某些选项卡时,我想执行一些代码。这是我到目前为止所拥有的:
.xhtml
<p:tabView id="tabsView" widgetVar="tabPanelWidget" dynamic="true" cache="true">
<p:ajax event="tabChange" listener="#{backingView.onTabChange}" process="@none" update="@none" immediate="true"/>
....
</p:tabView>
backingView.java
public void onTabChange(TabChangeEvent event) throws IOException {
if (event == null) return;
....
}
但是, onTabChange()
仅在我第一次切换到给定的选项卡。重新加载页面会“重置”此功能,但我通常希望每次切换选项卡时都执行该功能。有什么想法吗?
Primefaces 版本:6.2.17
I use Primefaces tabView to be able to switch between tabs. When the user switches to certain tabs, I want to execute some code. Here is what I have so far:
.xhtml
<p:tabView id="tabsView" widgetVar="tabPanelWidget" dynamic="true" cache="true">
<p:ajax event="tabChange" listener="#{backingView.onTabChange}" process="@none" update="@none" immediate="true"/>
....
</p:tabView>
backingView.java
public void onTabChange(TabChangeEvent event) throws IOException {
if (event == null) return;
....
}
However, onTabChange()
is only called the very first time I switch to a given tab. Reloading the page "resets" this, but I generally want the the function to be executed every time I switch tab. Any ideas?
Primefaces version: 6.2.17
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论