Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Primefaces: RequestContext.execute - Javascript called twice

I'm using primefaces and have a problem executing JavaScript at the end of an ajax call. I add some action to the RequestContext, and it is executed twice!

RequestContext.getCurrentInstance().execute("alert('I'm here!')");

It is also embedded twice in the XML which I get back from the server - two times the same component and same node.

Primefaces Version is 5.3.10

Any ideas what is going wrong here? Thanks.

like image 517
anm Avatar asked Nov 26 '22 04:11

anm


1 Answers

It has been a while since last answer and problem seems to be solved but I believe I know what is going on and the reason new deployment solved the problem.

It seems it happens when you have more than one primefaces*.jar inside EAR (i.e. EAR/lib and WAR/WEB-INF/lib.

If anyone else is facing this problem, try to remove from EAR/lib (or EAR root), keep only one primefaces*.jar in EAR.

like image 194
Emilio Numazaki Avatar answered Dec 05 '22 03:12

Emilio Numazaki