Free Support Forum - groupdocs.com

Cannot read property 'url' of undefined


#1

A client using your software is receiving this error when they click too many documents to load very quickly.



We have a list of documents on the side of screen each having a view button. When the view button is clicked we call the server and load the document. The document is coming from another service so we save it to the disk and then give the file name to the viewer to load. If you click multiple buttons very quickly you get this error in the browser console.



To be clear everything works fine when doing things slowly or at a normal speed. Its only when you click view buttons too quickly, like just randomly clicking any and all of them as fast you can. I get why would anyone do that but unfortunately that isn’t something I can tell a client. I would prefer not to have to throw something up on the screen to stop all interaction since some docs can take a while to load depending on size and there are other things on screen they should be able to interact with.



Any ideas what it is and if its preventable in some way? Error is below.



GetScript?name=GroupdocsViewer.all.min.js:1 Uncaught TypeError: Cannot read property ‘url’ of undefined(anonymous function) @ GetScript?name=GroupdocsViewer.all.min.js:1$.extend._successHandler @ GetScript?name=GroupdocsViewer.all.min.js:1(anonymous function) @ GetScript?name=GroupdocsViewer.all.min.js:1a @ GetScript?name=GroupdocsViewer.all.min.js:1Accept @ GetScript?name=GroupdocsViewer.all.min.js:1w @ GetScript?name=GroupdocsViewer.all.min.js:1OnCompleted @ GetScript?name=GroupdocsViewer.all.min.js:1a.success @ GetScript?name=GroupdocsViewer.all.min.js:1c @ GetScript?name=libs/jquery-1.9.1.min.js:2p.fireWith @ GetScript?name=libs/jquery-1.9.1.min.js:2k @ GetScript?name=libs/jquery-1.9.1.min.js:4r @ GetScript?name=libs/jquery-1.9.1.min.js:4


#2

Hello Matt,


Thank you for your inquiry,

The scenario has been elaborated well. But please let us know the following information

1) What version of GroupDocs.Viewer are you using?
2) In which browser you are facing this issue?
3) Operating System information.
This information will help us to identify and log the issue properly.

Thanks in advance.

#3
  1. 2.9.1.0

    2. Chrome (Latest)

    3. Windows Server 2012, Windows Server 2008 R2



    I can try and see if this reproducible in other browsers/OS too and update but for now we have just looked in chrome and some windows OSes.

#4

Hi,


Thank you for this information. As I understand from the initial post the Viewer works well and fail only when user click the documents too fast - since that I can advice you such approach to avoid this behavior:
1. Set Groupdocs.Web.UI.ClientHelper EnableStandardErrorHandling ( Boolean enable ) to false - it will disable error messages from the Viewer.
2. When user clicks on any document to view it - make all other documents inactive until the selected document is loaded. To attache some JavaScript function (which will make other documents active back) you can use this JavaScript function:

containerElement.groupdocsViewer(“on”, “documentLoadCompleted.groupdocs”,
function (e) {
//activate other documents here
});

Best regards.