5

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

When I click on the button on the footer, it get change the frequency of the poll interval.

Bellow is the code sample;

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>
  • Both refresh button & poll tag calls to the same server side method (ServerSideClass.statusUpdate()) to load data.
  • If I don't press the button on the Footer.jsp, the poll intervals works correctly.
  • If that button press the interval frequency get change. (Page get refresh within 2,3 seconds)

Anything wrong with this implementation ?

TIA.

Apostolos
  • 10,033
  • 5
  • 24
  • 39
Harsha
  • 400
  • 1
  • 5
  • 16
  • It might just be that the interval of each poll stays the same but that you get 2 or 3 polls running at the same time... – Kukeltje Aug 25 '17 at 07:37
  • @Kukeltje Yes agree! That could be the possible cause. but how can I avoid running multiple polls at the same time? I guess it creates new poll when page get refresh... but old poll remain as it is.. – Harsha Aug 25 '17 at 07:39
  • No idea... I don't use Trinidad (the tr prefix suggests btw that it is a trinidad poll and not a jsf (2.3) poll. Maybe 'stop' the poll when an ajax call is made? – Kukeltje Aug 25 '17 at 07:49
  • Can you make sure there are no `CDATA` tags in your jsp scripts – Syed Anas Aug 28 '17 at 10:27
  • You'll be able to get a clearer picture of what's going on by inspecting your browser console. Confirm Kukeltje's working theory that multiple polls are triggered and go from there @Harsha – kolossus Aug 29 '17 at 00:02
  • Any progress??? If so I can answer the question – Kukeltje Apr 18 '18 at 09:12

0 Answers0