RadUpload not rendering under FireFox 3.0.10

Thread is closed for posting
6 posts, 1 answers
  1. Lenny_shp
    Lenny_shp avatar
    343 posts
    Member since:
    Jul 2006

    Posted 04 Jun 2009 Link to this post

    2009.1.527.35 Build
    If I have any of these in the aspx page it will not render in FF 3.0.10, FF 3.5b4, Chrome.  It renders in IE 7 fine.

                            OnClientFileSelected="checkExtension"    
                            OnClientDeleting="OnClientDeletingHandler"
                            OnClientDeletingSelected="OnClientDeletingSelectedHandler"

    1 (System Generated Code) Working in FF: 
    2  
    3 Sys.Application.add_init(function() { 
    4     $create(Telerik.Web.UI.RadUpload, {"_skin":"Default","allowedFileExtensions":"[\".mht\",\".txt\",\".pdf\",\".htm\",\".html\",\".doc\",\".xls\",\".ppt\",\".gif\",\".jpg\",\".tif\"]","clientStateFieldID":"myUpload_ClientState","controlObjectsVisibility":"2","enabled":true,"inputSize":80,"localization":{"Select":"Select","Remove":"Remove","Add":"Add","Clear":"Clear","Delete":"Delete"},"readOnlyFileInputs":false}, nullnull, $get("myUpload")); 
    5 }); 
    6  
    7  
    8 Not Working in FF when additional client script events are defined: 
    9  
    10 Sys.Application.add_init(function() { 
    11     $create(Telerik.Web.UI.RadUpload, {"_skin":"Default","allowedFileExtensions":"[\".mht\",\".txt\",\".pdf\",\".htm\",\".html\",\".doc\",\".xls\",\".ppt\",\".gif\",\".jpg\",\".tif\"]","clientStateFieldID":"myUpload_ClientState","controlObjectsVisibility":"2","enabled":true,"inputSize":80,"localization":{"Select":"Select","Remove":"Remove","Add":"Add","Clear":"Clear","Delete":"Delete"},"readOnlyFileInputs":false}, {"deleting":OnClientDeletingHandler,"deletingSelected":OnClientDeletingSelectedHandler,"fileSelected":checkExtension}, null, $get("myUpload")); 
    12 }); 


    1       function OnClientDeletingHandler(sender, eventArgs) { 
    2           var numberOfInputs = sender.getFileInputs().length; 
    3           if (numberOfInputs == 1) { 
    4               sender.clearFileInputAt(0); 
    5               eventArgs.set_cancel(true); 
    6           } 
    7       } 
    8  
    9       function OnClientDeletingSelectedHandler(sender, eventArgs) { 
    10           var numberOfInputsToDelete = eventArgs.get_fileInputFields().length; 
    11           var totalNumberOfInputs = sender.getFileInputs().length; 
    12  
    13           if (totalNumberOfInputs == numberOfInputsToDelete) { 
    14               eventArgs.set_cancel(true); 
    15           } 
    16       } 
    17  
    18       function checkExtension(radUpload, eventArgs) {           
    19           var input = eventArgs.get_fileInputField(); 
    20           if (!radUpload.isExtensionValid(input.value)) { 
    21               var inputs = radUpload.getFileInputs(); 
    22               for (i = 0; i < inputs.length; i++) { 
    23                   if (inputs[i] == input) { 
    24                       alert(input.value + " does not have a valid extension."); 
    25                       radUpload.clearFileInputAt(i); 
    26                       break
    27                   } 
    28               } 
    29           } else { 
    30               radUpload.addFileInput(); 
    31           } 
    32       } 
    1             <div id="divNewAttachments" runat="server" style="float:none; height:auto; border-style: none; padding:5px 5px 5px 5px;"
    2                     <span id="lblAttachments" style="float:left" class="labelA">Add Document:&nbsp;</span> 
    3                     <telerik:RadUpload ID="myUpload" runat="server" InputSize="80" Width="700px" TabIndex="20"  
    4                         ControlObjectsVisibility="RemoveButtons"  
    5                         EnableFileInputSkinning ="true" 
    6                         AllowedFileExtensions=".mht,.txt,.pdf,.htm,.html,.doc,.xls,.ppt,.gif,.jpg,.tif" 
    7                         OnClientFileSelected="checkExtension"     
    8                         OnClientDeleting="OnClientDeletingHandler" 
    9                         OnClientDeletingSelected="OnClientDeletingSelectedHandler"
    10                     </telerik:RadUpload> 
    11             </div>    
  2. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 08 Jun 2009 Link to this post

    Hello Leonid,

    Thank you for contacting us.

    Unfortunately I couldn't reproduce your issue. Both your Sys.Application.add_init methods work if they are placed at the end of a file with your declaration of RadUpload and your client handlers. Maybe the problem has something to do with the declaration order. Can you send me a sample project in which you're experiencing the issue, so I can check what isn't working? Thank you in advance.

    Greetings,
    Kamen Bundev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Lenny_shp
    Lenny_shp avatar
    343 posts
    Member since:
    Jul 2006

    Posted 28 Dec 2009 Link to this post

    Same behavior with 2009.3.1210.35.
    It does not work when the scripts are inside a .js file. 
    <script src="JScript.js" type="text/javascript"></script>

    It works if the scripts are embedded in the aspx.


  4. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 29 Dec 2009 Link to this post

    Hello Lenny_shp,

    Can you post the whole content of the aspx file and the included javascript file, so that we can be able to properly test it? I'm not experiencing such issue here. Note that it is generally advisable to define your handlers in the head tag, so that they can be available when needed. If you define/include them at the end of the file, it is possible that the controls you're using initialize before you define them, thus resulting in an error.

    Greetings,
    Kamen Bundev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Lenny_shp
    Lenny_shp avatar
    343 posts
    Member since:
    Jul 2006

    Posted 30 Dec 2009 Link to this post

    Ah, when I have this in my test.js the fileinput is not rendered.   I placed these 2 functions into a separate .js file now the upload renders in FF.

    function window.onafterprint() {
    }

    function window.onbeforeprint() {
      }



  6. Answer
    T. Tsonev
    Admin
    T. Tsonev avatar
    2834 posts

    Posted 04 Jan 2010 Link to this post

    Hi Lenny,

    This is in fact invalid JavaScript. The correct way to attach events to the window object is as follows:
    window.onafterprint = function() { };

    Or you can use the MS AJAX framework $addHandler method to attach multiple handlers:
    $addHandler(window, "afterprint", function() { });

    I hope this helps.

    Regards,
    Tsvetomir Tsonev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top