Upload warnings are javascript alerts

4 posts, 0 answers
  1. Peter
    Peter avatar
    71 posts
    Member since:
    Mar 2012

    Posted 27 Mar 2014 Link to this post

    Can the upload warnings be configured to display as a radwindow?   

    The FileExplorer has a windowmanager, why shouldn't any warnings be displayed as javascript alerts.  (ie: File Exists, File Size/Extension)

    Peter
  2. Vessy
    Admin
    Vessy avatar
    1380 posts

    Posted 01 Apr 2014 Link to this post

    Hi Peter,

    Indeed we are using standard browser alerts for displaying error messages in FileExplorer, but switching to RadAlerts now will be a breaking change for the control. Nevertheless, if you prefer to use RadAlerts for file validation in your application, you can do it by adding the following overrides to the end of the page containing FileExplorer:
    <script>
        Telerik.Web.UI.RadFileExplorer.prototype._onAsyncUploadValidationFailed = function (sender, args) {
            var manager = this.get_windowManager();
            if (manager)
            {
            var loc = this.get_localization();
            manager.radalert(args.get_fileName() + "<br/><br/>" + loc["InvalidFileSize"] + "<br/>" + loc["InvalidFileExtension"], 400, 150);
            }
        }
     
        Telerik.Web.UI.RadFileExplorer.prototype._onWindowClose = function(oWnd, args)
        {
            if (!oWnd._isPredefined && args.get_argument() != "SenderIsBtnUpload" && this.get_asyncUpload() != null)
            {
                this.get_asyncUpload().deleteAllFileInputs();
            }
     
            var self = this;
            window.setTimeout(function()
            {
                if(self._lastFocusedElement)
                    self._focus(self._lastFocusedElement);
            },0);
        }
    </script>

    Unfortunately, these are the only alerts that can be manipulated in this way, thus the others are directly called from a private methods on the Server.

    Kind regards,
    Vessy
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter
    Peter avatar
    71 posts
    Member since:
    Mar 2012

    Posted 01 Apr 2014 in reply to Vessy Link to this post

    Thank you for the information.   But the lack of using WindowManager for all messages generated by the asyncuploader will limit are replacement of radupload in another application.

    Please consider adding an option "ShowWarningsAsAlerts", default to true.   
  5. Vessy
    Admin
    Vessy avatar
    1380 posts

    Posted 03 Apr 2014 Link to this post

    Hi Peter,

    Thank you for your suggestion.

    I have added it as a feature request into our feedback portal, so you can track its progress and vote for it here: Add a ShowWarningsAsAlerts property to RadFileExplorer. If many people vote on it our developers will consider the implementation of such a feature.

    As a small token of gratitude for your suggestion I have added 500 Telerik points to your account.

    Regards,
    Vessy
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top