Hello,

I use polling for the table, but I do not need to poll all the time. So,
after I get information I need, I disable polling by setting polling
interval to a very big number. It works, but when I go to the next page of
the table, I need to enable polling to get information for the new page. I
tried to change polling interval, but it did not work. My jsp page is :

                <tr:poll pollListener="#{accountBean.onPoll}" interval="1000"
id="pollBalances"/>
                <tr:table width="550" var="period" 
partialTriggers="::pollBalances"
                        value="#{accountBean.accountPeriodsCollectionModel}" 
rows="25"
                        horizontalGridVisible="false" 
verticalGridVisible="true">
                          ...
                </tr:table>

onPoll method where I disable polling is here:

    public void onPoll(PollEvent event) {
        //get information I need and update table data model
                 ....
        CorePoll pollingComponent = (CorePoll)event.getComponent();
        pollingComponent.setInterval(10000000); //deactivate pooling, set to
2 hours
  
    }

listener method, which is called when next page of the table is loaded:

    private class AccountPeriodRefreshCollectionListener implements
RefreshCollectionListener {
        
        public DataPage refreshCollection(List<SortCriterion> sortCriteria,
int rangeStart, int rangeEnd) {
            DataPage nextPage =
accountingService.getAccountPeriods(getAccountId(), sortCriteria,
rangeStart, rangeEnd);

            pollingComponent.setInterval(1000); //try to enable polling, but
it does not work
       }
   }

Could you, please, help me with some advice if you know how to solve this
problem?

Thank you, Lena
-- 
View this message in context: 
http://www.nabble.com/problem-with-disabling-polling-for-one-page-of-the-table-and-enabling-it-for-the-next-page-of-the-table-tp24861084p24861084.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to