The polling interval gets changed when the page is refreshed in JSF

I used the JSF polling tag to reload the data table in my JSP. And there is another JSP in the footer. It has a button to reload the page with new data.

The problem is this:

When I click the button on the footer , it gets the change in the polling interval frequency.

The following is sample code;

main.jsp

<et:partialTriggerGroup id="statusUpdatePoller"> <tr:poll interval="10000" id="statusUpdatePoller" pollListener="#{ServerSideClass.statusUpdate}"/> <m:dataTable> ... </m:dataTable> </et:partialTriggerGroup> 

Footer.jsp

 <et:partialTriggerGroup id="pageControlTrigger"> ... <tr:commandLink action="#{ServerSideClass.statusUpdate}" partialSubmit="true" /> </et:partialTriggerGroup> 
  • To download data, both update buttons and the polling tag use the same server-side method (ServerSideClass.statusUpdate ()).
  • If I don’t click the button on Footer.jsp, the polling intervals work correctly.
  • If this button presses the interval, then we get a change. (Page refreshes in 2.3 seconds)

Is there something wrong with this implementation?

TIA.

+5
source share

Source: https://habr.com/ru/post/1271191/


All Articles