This is a migrated thread and some comments may be shown as answers.

javascript error: "o is undefined"

2 Answers 85 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
John Chatt
Top achievements
Rank 1
John Chatt asked on 25 May 2010, 05:50 PM
i keep getting this error at random times. it's rarely with the same file and I can't seem to get it to happen consistently. I have no idea why it is happening but whenever it does it freezes the upload.

it happens at this line of code

"if(c(o.rowElement).parents().length==0){return;0}"

inside the telerik control's web resource

2 Answers, 1 is accepted

Sort by
0
Daniel Gioulakis
Top achievements
Rank 1
answered on 26 May 2010, 06:04 PM
Hi,
Working with John we've uncovered a little more where the problem lies.  Within RadAsyncUpload.js we encounter a nullreference or "undefined" exception in the function below:

"frameDocument" becomes set, however, "inputInfo" is undefined.

_onFrameLoad : function (frame, inputInfo) { 
            var frameDocument = null
             
            try { 
                frameDocument = frame.contentDocument || frame.contentWindow.document
            } 
            catch (e) { 
                this._onFileUploadFail(inputInfo, ""); 
                return;                     
            } 
             
            if (frameDocument) { 
                if($(inputInfo.rowElement).parents().length == 0) 
                    return

The problem can be consistently reproduced, though the process is fairly complex.  We have a page which contains a user control, which in turn, contains our AsyncUploader.

Our page displays the user control via an async postback using RadAjaxManager.  The user control is always on the page, but initially visibility is set to false.

See Screenshots:
screenuchidden.jpg -> Page with user control hidden
screenucvisible.jpg -> User control shown

To replicate the problem, we show the user control and hit "Save" without attaching anything with the AsyncUpload.  The user control is then hidden again.

We then go to add another "New Proof", and attach a file. When the AsyncUpload process starts it breaks with the exception John had mentioned in his original post.  Strangely, we can then click "Remove" on the uploader and re-select a file and the upload process works again.

In an attempt to summarize our problem: When we try to attach/upload a file, the upload always works ... unless it's followed by a postback in which no file was selected for attachment.


If I can clear this up any further please let me know. Thanks!

Daniel

0
Daniel Gioulakis
Top achievements
Rank 1
answered on 26 May 2010, 08:36 PM
Bug fixed!

Note for other Telerik users who might encounter this error.
Updating your RadControls to the most recent version (RadControls for ASP.NET AJAX Version: 2010.1 519 (May 19, 2010) at time of writing this) will fix this bug.

Thanks!
Tags
AsyncUpload
Asked by
John Chatt
Top achievements
Rank 1
Answers by
Daniel Gioulakis
Top achievements
Rank 1
Share this question
or