开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜