当页面重新加载时,请保持调用操作方法。
我只想在点击链接时调用此动作方法。
<li role="presentation">
<a role="menuitem" tabindex="-1" href="ViewAMC.xhtml" action="# {treeTableManagedBean.testingActionListener()}" >View AMC</a>
</li>
public void testingActionListener()
{
System.out.println("testing action listener!");
flag = false;
}
答案 0 :(得分:0)
<h:commandLink action="#{treeTableManagedBean.testingAction()}" value="Click Here" actionListener="#{treeTableManagedBean.myActionListener}">
public void myActionListener(ActionEvent event) {
System.out.println("testing action listener!");
}
public String testingAction() {
System.out.println("testing action !");
return "ViewAMC.xhtml";
}
试试这个。