-1

While page is reload, keep calling action method.

I only want to call this action method when link is clicked.

<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;
}
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Alice
  • 111
  • 1
  • 10

1 Answers1

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

Try this out.

Tomz
  • 85
  • 5