开发者

Richfaces: call multiple methods in s:link's action attribute

开发者 https://www.devze.com 2023-03-20 05:07 出处:网络
Currently I have: action=\"#{A.actionA() && B.ActionB()}\" But I get the error: Not a Valid Method Expression: #{A.actionA() && B.A开发者_如何学CctionB()}

Currently I have:

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

But I get the error:

Not a Valid Method Expression: #{A.actionA() && B.A开发者_如何学CctionB()}

How can I fix this?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号