p:ajax dead after some time

UI Components for JSF
Post Reply
PGoldwin
Posts: 18
Joined: 26 Mar 2012, 09:55

04 May 2018, 13:23

In my startup screen there is selection between "Login" or "Register". Selecting any uses p:ajax to show login/register fields.

Code: Select all

<h:commandLink type="submit"  value="Logga in"  styleClass="link-button">
	<p:ajax event="click" listener="#{loginTypController.ajaxLoginSelected}" update="sectionSelection"/>
</h:commandLink>
If I leave the startup page for say 20 minutes the p:ajax event is no longer working. F5 for refreshing the page and now is it working again.

Any suggestions how I can solve this problem?

Env:
- Liferay 6.2
- JSF 2.2 portlet
- Primeface 6.2

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

08 May 2018, 08:49

Did you check for errors? Network tab in the console, server side logging? And more... I suspect a session timeout. Always good to add an ajax error handler.

PGoldwin
Posts: 18
Joined: 26 Mar 2012, 09:55

09 May 2018, 08:51

No errors in Chrome console log (F12).

How do I add ajax error handling?

PGoldwin
Posts: 18
Joined: 26 Mar 2012, 09:55

09 May 2018, 10:01

I added error handler:

Code: Select all

<p:ajaxExceptionHandler type="javax.faces.application.ViewExpiredException" update="exceptionDialog" onexception="PF('exceptionDialog').show();" />
Nothing was shown by error handler.

Now I payed more attention to Tomcat log:
09:57:27,554 ERROR [ExceptionHandlerBridgeImpl:81] viewId:/views/loginTypIntro.xhtml - View /views/loginTypIntro.xhtml could not be restored.
Any suggestions?

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

10 May 2018, 20:06

Post the 'error' in google. Not a PrimeFaces issue but a generic JSF one. Can be multiple causes... From a plain session timeout to more complex things (to little views in cache etc...)

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

11 May 2018, 11:06


PGoldwin
Posts: 18
Joined: 26 Mar 2012, 09:55

25 May 2018, 10:12

Thanks for pointing me in the right direction. Clumsy of me not to google the error. Usualy this is done but since I found the error message after first post was made I forget that step.

Problem not solved yet but now I know where to look.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

25 May 2018, 19:44

Thanks for the feedback!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 56 guests