0 Replies Latest reply on Nov 6, 2008 3:04 PM by Martin Dubuc

    Issues with a4j:poll?

    Martin Dubuc Newbie

      I have created a page that uses a4j:poll to update status information in one of my pages. I have noticed that ever since adding this component, I keep getting some exceptions when I navigate away from this page. These exceptions happen sporadically, say once every 10 times. When I navigate away from any other page that do not contain an a4j:poll, I never get these exceptions. The most frequent exception that I get is a duplicateId exception. At some point, I noticed that there were times when the application would render the content of both the previous and the next page on the same page. All my tables had the same id, so that would cause an issue. I changed the ids of all my tables to be unique and added some code to reload the current page if the application detects two tables are present on the page. This fixes this problem. It is a hack but it works. However, while trying to fix this issue, I added ids to most of the components on my pages. Most of them are unique. But I still get the duplicateId exception from time to time on ids that are unique.

      I also get some other exceptions, like java.util.NoSuchElementException, IllegalArgumentException. If I reload the page, the page is rendered properly. I am not sure if others have seen such problem and what can be done to troubleshoot the application to figure out where the problem lies. For instance, when such an exception is encountered, it would be nice to dump the actual component tree to see why we get a duplicateId exception.

      Another issue I have with a4j:poll, which is not as serious, but I am wondering if there is a way around this. If I am viewing a page that has a a4j:poll component, some region of my page is rerendered on a periodic basis. Now, if I restart the Web server (Tomcat in this case), while this page is up, the application will automatically present the login prompt (my application requires authentication). After logging in, the results of the last a4j:poll update is rendered. I would like this content to be discarded, because I need the whole page to be refreshed, not be presented with only a portion of the page and nothing else.