如何在刷新页面时停止调用action / actionListener / onclick / oncomplete

时间:2016-06-14 06:00:37

标签: jsf

当页面重新加载时,请保持调用操作方法。

我只想在点击链接时调用此动作方法。

<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;
}

1 个答案:

答案 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";
    }

试试这个。