Only in Firefox, using getRadWindow().close(workLink); does not allow a OnClick call from an ASP:LinkButton to fire. There does not seem to be an issue with using a ASP:Button.
If I yank out the following, it fires.
Here's my code.
If I yank out the following, it fires.
console.log("begin trouble"); workLink.pages = pageValue; //pages.value <-- just swapped out for pageValue variable; selectedText += ")</a>"; workLink.selectedText = selectedText; getRadWindow().close(workLink); //use the close function of the getRadWindow to close the dialog and pass the arguments from the dialog to the callback function on the main page. Here's my code.
<asp:LinkButton ID="cmdUpdate" CssClass="dnnPrimaryAction" resourcekey="cmdUpdate" Text="Save and Exit" runat="server" OnClick="cmdUpdate_Click" OnClientClick="if(!insertLinkFromDB()){return false;};" UseSubmitBehavior="false" ></asp:LinkButton>
if (window.attachEvent) { window.attachEvent("onload", initDialog); } else if (window.addEventListener) { window.addEventListener("load", initDialog, false); } var pages = document.getElementById("pages"); var workLink = null; function getRadWindow() { if (window.radWindow) { return window.radWindow; } if (window.frameElement && window.frameElement.radWindow) { return window.frameElement.radWindow; } return null; } function initDialog() { var clientParameters = getRadWindow().ClientParameters; //return the arguments supplied from the parent page pages.value = clientParameters.innerHTML; workLink = clientParameters; }function insertLinkFromDB() //fires when the Insert Link button is clicked on the "New Item" Screen { //create an object and set some custom properties to it var authorLastValue = $('#referenceAuthor').val(); var dateValue = $('#referenceYear').val(); var currentId = $('.highlighted').attr('id'); var selectedText; selectedText = "<a href=\"#citation_" + currentId + "\">(" + authorLastValue + ", " + dateValue; var pageValue = $('#pages2').val(); if (pageValue != "") { selectedText += " Pg " + pageValue; } console.log("begin trouble"); workLink.pages = pageValue; //pages.value <-- just swapped out for pageValue variable; selectedText += ")</a>"; workLink.selectedText = selectedText; getRadWindow().close(workLink); //use the close function of the getRadWindow to close the dialog and pass the arguments from the dialog to the callback function on the main page. return true; }//This is a radwindow workaround. Buttons call the closewindow function function closeWindow() { GetRadWindow().close(); } function GetRadWindow() { var oWindow = null; if (window.radWindow) oWindow = window.radWindow; else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; return oWindow; }