Hello,
I am trying to do a number of things with a RadComboBox and RadAsyncUpload inside a RadWindow:
The problem is that in my FileSelected function, no files are returned for getUploadedFiles() and in my FileUploaded function getSelectedItem() is null.
Can anyone tell me why this is? Am I doing anything wrong?
Thanks,
Jo
I am trying to do a number of things with a RadComboBox and RadAsyncUpload inside a RadWindow:
<telerik:RadWindowManager ID="RadWindowManager1" Behaviors="Close" runat="server" Modal="true" Width="900px"> <Windows> <telerik:RadWindow ID="RadWindowApprove" runat="server"> <ContentTemplate> <h3> Approve Supplier Agreement</h3> <table> <colgroup> <col class="first-column" /> </colgroup> <tr> <td> Document: </td> <td> <telerik:RadComboBox ID="RadComboBoxDocument" runat="server" EmptyMessage="Choose an existing SPA" AllowCustomText="true"> </telerik:RadComboBox> </td> </tr> <tr> <td></td> <td>or upload a new one</td> </tr> <tr> <td></td> <td><telerik:RadAsyncUpload ID="RadAsyncUploadDocument" runat="server" ControlObjectsVisibility="None" MultipleFileSelection="Disabled" MaxFileInputsCount="1" AllowedFileExtensions="pdf" OnClientFileUploaded="FileUploaded"> </telerik:RadAsyncUpload></td> </tr> </table> <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> <script type="text/javascript"> //<![CDATA[ // File selected so remove any uploaded files function FileSelected(sender, args) { var fileUpload = $find('<%= RadAsyncUploadDocument.ClientID %>'); var inputs = fileUpload.getUploadedFiles(); for (i = inputs.length - 1; i >= 0; i--) { fileUpload.deleteFileInputAt(i); } } // File uploaded so unselect any selected file function FileUploaded(sender, args) { var combo = $find('<%= RadComboBoxDocument.ClientID %>'); alert(combo.get_selectedItem().get_text()); combo.clearSelection(); } //]]> </script> </telerik:RadScriptBlock> </ContentTemplate> </telerik:RadWindow> </Windows> </telerik:RadWindowManager>The problem is that in my FileSelected function, no files are returned for getUploadedFiles() and in my FileUploaded function getSelectedItem() is null.
Can anyone tell me why this is? Am I doing anything wrong?
Thanks,
Jo