2

I have a really strange problem with xpages that I see from time to time. I think it has to do with the dynamic content control

I have seen this error before in other situations but never understood what is causing it and how to prevent it from happening.

In this case I have a dynamic control from extlib loaded containing a jquery plugin that loads a calendar. the calendar works fine. but if I click the calendar navigation three times and then after that try to reload my dynamic content control it freaks out with a strange url and keeps reloading. (the calendar navigation does a ajax request to fetch json everytime it is clicked)

I am looking for a way to prevent or catch these errors so that user do not have to experience them.

I have attached an animation of the problem as it is kind of hard to explain.

the url that keeps reloading looks like this, "home" is the xpage, "dynC is the control and "booking" is the content loaded.

demo.intrapages.com/intrademo.nsf/home.xsp?%24%24ajaxid=home%3A_id1%3AdynC&content=booking&%24%24viewid=!dqeyhl895m!

enter image description here

you can reproduce the problem here I also noticed that it works in Firefox

Thomas Adrian
  • 3,543
  • 6
  • 32
  • 62

1 Answers1

2

it looks like the Partial refresh from the calendar button gets in the way of the partial refresh from the booking link.
Imagine:
The XHR request is send off and not fully complete. A second request gets send and completes faster. The second alters the local Dom and the handler function for the first on completion doesn't find the hooks it wants to write to and retries the request.

Potential remedy:
Alter your refresh button to either ignore the second request if the first isn't fully complete or use an Ajax spinner graphic and the gray mask (Standby control)

stwissel
  • 20,110
  • 6
  • 54
  • 101
  • thanks for your answer, if you look in dev tools you see that even if the request is finnished it breaks the dynamic control refresh. but not the first time, not the second time, but the third time. it does not seem to matter how long time goes between the clicks – Thomas Adrian Mar 14 '14 at 15:34
  • Hhmm. The server side model might get the confusion then – stwissel Mar 15 '14 at 05:57
  • 1
    You mention "3". Might be related to xsp.persistence.tree.maxviews . Can you try making that value higher and see if it takes longer for it to occur? – Simon O'Doherty Apr 03 '14 at 06:13
  • Simon, you just solved my problem, I set the value to 10 and it works much better. do you have any idea what impact a higher value may have? If you add your comment as an answer here I will be happy to add it as the solution to my problem. thanks again – Thomas Adrian Apr 03 '14 at 18:15