1
votes

i'm using PrimeFaces 5, Glassfish server ver.4 and firefox as browser. I'm developing a web app via Netbeans8.0.1 where in index.xhtml page I need to show a list of tips at each login. To do this i'm using this code in my index.xhtml page

<f:event type="preRenderView" listener="#{promemoriaController.promemoriaInScadenza()}"/>

This "f:event" is outside the "f:metadata> tag. I don't know why but the f:event listner is executed twice at every login. I'm sure that the usage of the promemoriaController.promemoriaInScadenza() is only in the f:event>. Thank's a lot for your replies

2
can you provide the path of it's parent elements, from <html> to <f:event> ? - yannicuLar
also, do you have any components with autoUpdate="true"? or any event that reloads the whole @Form - yannicuLar
I'm using Netbeans 8.0.1. How can i find the path from <html> to <f:event> while running ? For element with autoupdate="true" i'haven't find nothing. - Claudio Cerino
Ok i have found <p:growl > with autoupdate="true". After delete it all works well. - Claudio Cerino

2 Answers

1
votes

Looks like the container of this <f:event>element, is rendered 2 times. 1 from the initial page load, and another one, probably from some ajax action

You could check all the parent elements of this , and see if any of these is called to update from another action. Using the autoupdate="true" attribute can also trigger some unexpected updates and re-renderings

-1
votes

Check if your <f:event/> tag is inside <f:metadata> - if so, put it outside.