0

Currently I have:

action="#{A.actionA() && B.ActionB()}"

But I get the error:

Not a Valid Method Expression: #{A.actionA() && B.ActionB()}

How can I fix this?

TookTheRook
  • 817
  • 4
  • 14
  • 31

1 Answers1

2

AFAIK , the EL expression does not allow calling several methods in one expression.

I suggest you can wrap these two functions to a new function and then call this new function instead.

For example ,

action="#{bean.onPressLink()}"

And the onPressLink() will call A.actionA() and B.actionB()

public void onPressLink(){
     //Get the managed bean called A and then call its actionA();
     //Get the managed bean called B and then call its actionB();
}

To get the managed bean by its name , you can refer to this thread.

Community
  • 1
  • 1
Ken Chan
  • 84,777
  • 26
  • 143
  • 172