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

RadUpload not rendering under FireFox 3.0.10

5 Answers 115 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Lenny_shp
Top achievements
Rank 2
Lenny_shp asked on 04 Jun 2009, 08:30 PM
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"

(System Generated Code) Working in FF: 
 
Sys.Application.add_init(function() { 
    $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")); 
}); 
 
 
Not Working in FF when additional client script events are defined: 
 
Sys.Application.add_init(function() { 
    $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")); 
}); 


      function OnClientDeletingHandler(sender, eventArgs) { 
          var numberOfInputs = sender.getFileInputs().length; 
          if (numberOfInputs == 1) { 
              sender.clearFileInputAt(0); 
              eventArgs.set_cancel(true); 
          } 
      } 
 
      function OnClientDeletingSelectedHandler(sender, eventArgs) { 
          var numberOfInputsToDelete = eventArgs.get_fileInputFields().length; 
          var totalNumberOfInputs = sender.getFileInputs().length; 
 
          if (totalNumberOfInputs == numberOfInputsToDelete) { 
              eventArgs.set_cancel(true); 
          } 
      } 
 
      function checkExtension(radUpload, eventArgs) {           
          var input = eventArgs.get_fileInputField(); 
          if (!radUpload.isExtensionValid(input.value)) { 
              var inputs = radUpload.getFileInputs(); 
              for (i = 0; i < inputs.length; i++) { 
                  if (inputs[i] == input) { 
                      alert(input.value + " does not have a valid extension."); 
                      radUpload.clearFileInputAt(i); 
                      break
                  } 
              } 
          } else { 
              radUpload.addFileInput(); 
          } 
      } 
            <div id="divNewAttachments" runat="server" style="float:none; height:auto; border-style: none; padding:5px 5px 5px 5px;"
                    <span id="lblAttachments" style="float:left" class="labelA">Add Document:&nbsp;</span> 
                    <telerik:RadUpload ID="myUpload" runat="server" InputSize="80" Width="700px" TabIndex="20"  
                        ControlObjectsVisibility="RemoveButtons"  
                        EnableFileInputSkinning ="true" 
                        AllowedFileExtensions=".mht,.txt,.pdf,.htm,.html,.doc,.xls,.ppt,.gif,.jpg,.tif" 
                        OnClientFileSelected="checkExtension"     
                        OnClientDeleting="OnClientDeletingHandler" 
                        OnClientDeletingSelected="OnClientDeletingSelectedHandler"
                    </telerik:RadUpload> 
            </div>    

5 Answers, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 08 Jun 2009, 11:21 AM
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.
0
Lenny_shp
Top achievements
Rank 2
answered on 28 Dec 2009, 04:26 PM
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.


0
Kamen Bundev
Telerik team
answered on 29 Dec 2009, 02:01 PM
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.
0
Lenny_shp
Top achievements
Rank 2
answered on 30 Dec 2009, 02:43 PM
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() {
  }



0
Accepted
T. Tsonev
Telerik team
answered on 04 Jan 2010, 09:56 AM
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.
Tags
Upload (Obsolete)
Asked by
Lenny_shp
Top achievements
Rank 2
Answers by
Kamen Bundev
Telerik team
Lenny_shp
Top achievements
Rank 2
T. Tsonev
Telerik team
Share this question
or