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

Bug with RadWindow ContentArea

5 Answers 109 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 17 Apr 2010, 11:17 AM
Hi, there seems to be a bug in the latest version using the Async Upload Control in the ContentArea of the RadWindow when the VisibleOnPageLoad property is set to False (in Firefox), presumably because the control is not visible.

When you select a file for the first time, on the first show of the RadWindow, the file fails to upload continually spinning icon. Clicking remove, and re-trying works as expected. A javascript error is raised "o is undefined" around line 9278 (of the WebResource).

Within this block:

a.RadAsyncUpload.prototype={initialize:function(){a.RadAsyncUpload.callBaseMethod(this,"initialize"); 
this.add_fileUploaded(c.proxy(this._onFileUploadEnd,this)); 
this.add_fileUploadFailed(c.proxy(this._onFileUploadEnd,this)); 
if(this._getIsManagerDeclared()){getRadProgressManager()._addParamToCallbackUrl("type","rau"); 
}},appendStyledFileInput:function(k){var f=this.createFileInput(); 
this._fileInput=f; 
$addHandlers(f,{change:this.uploadFileSelected},this); 
if($telerik.isIE){$addHandlers(f,{mousedown:this._getFileInputMouseDownHandler(),mouseup:this._getFileInputMouseUpHandler()},this); 
}var h=f.id; 
var e=h+"frame"
var d=c("<iframe name='"+e+"' id='"+e+"'/>"); 
this._inputsDictionary[e]={rowElement:k,inputId:h}; 
var l=this
var j=c("<form class='ruForm' action='"+this._handlerUrl+"' method='post' encoding='multipart/form-data' enctype='multipart/form-data' target='"+h+"frame'/>"); 
j.attr("id",h+"form"); 
j.appendTo(document.body); 
d.insertAfter(j); 
d.css("display","none"); 
var g=document.createElement("span"); 
g.className="ruFileWrap"
var i=function(){var o=l._inputsDictionary[this.name]; 
var p=null
try{p=this.contentDocument||this.contentWindow.document
}catch(q){l._onFileUploadFail(o,""); 
return
}if(p){if(c(o.rowElement).parents().length==0){return
}var m=""
try{m=c.parseJSON(p.body.innerHTML); 
}catch(q){l._onFileUploadFail(o,p.body.innerHTML); 
return
 

The crashing line being:.... (Can someone please test this and see if there is some sort of easy workaround)... Thanks, SHaun.

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

5 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 20 Apr 2010, 09:43 AM
Hi Shaun,

Is your the RadAsyncUpload ajaxified in some way, using RadAjaxManager, for example? Could you try to remove RadAsyncUpload from the ajaxified controls. Does the issue persist?

All the best,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Shaun
Top achievements
Rank 1
answered on 21 Apr 2010, 06:36 AM
Hi - no, I already looked into that. As mentioned, it works fine if the VisibleOnPageLoad attribute is set to true. I am confident if you tried to replicate it you could. Because the control is not visible, it is not correctly instantiating itself in the page.

Put a AsyncUploadControl inline within a RadWindow (in the ContentArea - not NavigationUrl), with VisibleOnPageLoad=False.
0
Genady Sergeev
Telerik team
answered on 23 Apr 2010, 04:53 PM
Hello Shaun,

I have tried to reproduce the issue on a sample project, however, no avail. I am attaching my test project to this replay. Could you please tell us whether there are any significant differences compared to your project? Perhaps I am missing something, can you reproduce the issue on the sample?

Greetings,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Shaun
Top achievements
Rank 1
answered on 01 May 2010, 01:12 PM
Hi - thanks for your reply. I have managed to reproduce the issue using your code-solution. It is present when the outer window is ajaxified, and you attempt to open the window via Javascript placed on a server-side event... code below... I will try and get around this another way but it would be great if this could be looked at if there was some way to achieve this approach.

<form id="form1" runat="server"
         
        <script type="text/javascript"
            function openWindow() { 
                var window = $find("RadWindow1"); 
                window.show(); 
            }  
         
        </script> 
     
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
         
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="Button1"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadWindow1" UpdatePanelRenderMode="Inline" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
         
        <asp:Button runat="server" ID="Button1" Text="Open RadWindow" OnClick="Button1_Click"  /> 
         
        <telerik:RadWindow ID="RadWindow1" runat="server"
            <ContentTemplate> 
                        <telerik:RadAsyncUpload ID="RadAsyncUpload2" runat="server"
                        </telerik:RadAsyncUpload> 
            </ContentTemplate> 
        </telerik:RadWindow> 
     
    </form> 

Code behind, on the button click, register some javascript to open the window.

 
public partial class _Default : System.Web.UI.Page  
    protected void Button1_Click(object sender, EventArgs e) 
    { 
        this.RadAjaxManager1.ResponseScripts.Add("openWindow();"); 
    } 

And I know it can be fired from the client-side, but I was attempting to change the visible contents of the RadWindow template, ie. Showing a range of fields depending on the circumstance, which was easist to do on the server-side rather than client-side hiding of fields.

Thanks for your time and appreciate you looking into this.

Shaun.




0
Genady Sergeev
Telerik team
answered on 04 May 2010, 02:19 PM
Hi Shaun,

RadAsyncUpload has problems to work when it is inside a control that has been ajaxified. The good news that we have fixed this issue for the service pack and there should be no problems. I suggest that you upgrade to the latest version if you want to use RadAsyncUpload inside an ajaxified RadWindow.

Greetings,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
AsyncUpload
Asked by
Shaun
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Shaun
Top achievements
Rank 1
Share this question
or