0
我看起来像一个菜单:号码:菜单项不调用动作监听
<h:form>
<p:menu>
<p:menuitem value="One" actionListener="#{tabsVO.changeTab(1)}" update="tabView"/>
<p:menuitem value="Two" actionListener="#{tabsVO.changeTab(2)}" update="tabView"/>
<p:menuitem value="Three" actionListener="#{tabsVO.changeTab(3)}" update="tabView"/>
</p:menu>
</h:form>
相应的bean:
@ManagedBean
@ViewScoped
public class TabsVO{
private int currentTab;
@PostConstruct
public void init() {
currentTab = 0;
}
public void changeTab(int tabIndex){
this.currentTab = tabIndex;
}
public int getCurrentTab() {
return currentTab;
}
public void setCurrentTab(int currentTab) {
this.currentTab = currentTab;
}
}
一切似乎都不错,但不调用action listener
并没有任何反应上点击菜单项。