I have discovered that the solution offered for moving a custom dialog box from its' automatically centered position does not work.
Well, it does work, but when you successfully complete the dialog box (i.e. hitting a submit button), the RadWindow dialog reappears with no rhyme or reason and, furthermore, you can't close it or click any of the buttons.
I'm guessing this KB was published quite a long time ago and has changed in future releases of Telerik AJAX. Can you tell me if there's a way for me to fix this dilemma? I have to move the dialog because I have a footer where the dialog hides under if the browser window is too small.
Thanks again!
Well, it does work, but when you successfully complete the dialog box (i.e. hitting a submit button), the RadWindow dialog reappears with no rhyme or reason and, furthermore, you can't close it or click any of the buttons.
...
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
table
>
...
<
tr
id
=
"trFileName"
runat
=
"server"
>
<
td
><
asp:Label
ID
=
"lblFile"
runat
=
"server"
>File name:</
asp:Label
></
td
>
<
td
><
asp:FileUpload
ID
=
"txtFileName"
runat
=
"server"
EnableViewState
=
"true"
></
asp:FileUpload
></
td
>
</
tr
>
...
</
table
>
<
asp:TextBox
ID
=
"txtOldFile"
runat
=
"server"
style
=
"display:none;"
/>
<
asp:Button
ID
=
"btnSubmit"
runat
=
"server"
Text
=
"Update"
OnClientClick
=
"insertLink();"
/>
<
script
type
=
"text/javascript"
>
if (window.attachEvent) {
window.attachEvent("onload", initDialog);
}
else if (window.addEventListener) {
window.addEventListener("load", initDialog, false);
}
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
getRadWindow().moveTo(50, 50); // <----- Commenting this line does not result in the window reappearing.
//window.removeEventListener("load", initDialog, false); // <---- Tried this with no change in behavior.
workLink = clientParameters;
}
function insertLink() //fires when the Insert Link button is clicked
{
//create an object and set some custom properties to it
var file = document.getElementById("<%=txtFileName.ClientID%>");
var path = file.value;
var ext = path.substring(path.lastIndexOf(".") + 1, path.length).toLowerCase();
if (ext == null || ext == "") {
workLink.href = document.getElementById("<%=txtOldFile.ClientID%>").value;
} else {
workLink.href = ext;
}
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.
}
</
script
>
</
form
>
</
body
>
</
html
>
I'm guessing this KB was published quite a long time ago and has changed in future releases of Telerik AJAX. Can you tell me if there's a way for me to fix this dilemma? I have to move the dialog because I have a footer where the dialog hides under if the browser window is too small.
Thanks again!