2
votes

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

1
How do you control the dynamic content control? Do you use hashes or the show() method of the control itself via SSJS?Oliver Busse
XSP.showContent("#{id:dynC}","booking")Thomas Adrian
Did you try to just use the show() method with the content ID instead? Didn't use CSJS before but SSJS like getComponent("idOfDynamicControl").show("keyOfFacetPanel")Oliver Busse
I tried the SSJS version but it is the same problemThomas Adrian

1 Answers

2
votes

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)