Good Day Support
I am using a RadWindow to load another page that shows Google map , onClientClose event of the Window i successffully pass the Arguments and that works nice.
The issue i have is sometimes the Window does not close it keeps it open. i Open the Window with this code
Copy code
onload of the Popup there is Javascript that has a Popup a user can choose Yes or no depending on the Asnwer it can keep the popup open else close it , so i have provided the javascript that is related to the issue
Copy code
so if the variable "Desc" it will assign the textbox that is on the popup with variables and go to the method("CloseWithArg()")that will close the popup with Args as depicted below
So if the "Desc" is "true this will go to the else of this code. as you can see at the end i close it
and even emphesize closing it but it works sometimes, what is it that i am doing wrong?
Checked the F12 Error Chrome debugger there is no Error.
Thanks
I am using a RadWindow to load another page that shows Google map , onClientClose event of the Window i successffully pass the Arguments and that works nice.
The issue i have is sometimes the Window does not close it keeps it open. i Open the Window with this code
Copy code
function
GoogleEarthExtended() {
var
x = $(
"#ctl00_ContentPlaceHolder_Main_Wizard1_x"
).val();
var
y = $(
"#ctl00_ContentPlaceHolder_Main_Wizard1_y"
).val();
var
url =
'InsertGoogleEarthPhoto.aspx?type=roadmap'
+
'&x= '
+ x +
'&y= '
+ y +
'&hfGoogleMapsURLImage='
+ document.getElementById(
"<%=hfGoogleMapsURLImage.ClientID%>"
).value +
'&isHybrid=No'
;
var
wnd = window.radopen(url);
wnd.setSize(900, 600);
}
<asp:Button ID=
"butGoogleMap"
runat=
"server"
CssClass=
"but_lrg"
Height=
"32px"
OnClientClick=
"javascript:GoogleEarthExtended(); return false;"
Text=
"Insert Google Earth Map"
ToolTip=
"Insert a map of the property by using Google Earth."
UseSubmitBehavior=
"False"
Width=
"197px"
/>
onload of the Popup there is Javascript that has a Popup a user can choose Yes or no depending on the Asnwer it can keep the popup open else close it , so i have provided the javascript that is related to the issue
Copy code
//Check if there is a URL to for the Google map image
if
(getParameterByName(
'hfGoogleMapsURLImage'
) !=
""
) {
//if there is ask a User if he wants to use the current Image but of type "RoadMap"
var
desc = confirm(
'Do you want to insert a roadmap version of the above satellite image?'
);
}
else
{
var
desc =
false
}
//if the yes Choose Yes to use the RoadMap
if
(desc ==
true
) {
center = getParameterByName(
'center'
);
zoom =
"15"
;
maptype =
"roadmap"
;
x = getParameterByName(
'x'
);
y = getParameterByName(
'y'
);
//set the X and Y for Logic
document.getElementById(
"Latitude"
).value = x;
document.getElementById(
"Longitude"
).value = y;
CloseWithArg();
}
so if the variable "Desc" it will assign the textbox that is on the popup with variables and go to the method("CloseWithArg()")that will close the popup with Args as depicted below
function
CloseWithArg()
{
var
customArg;
if
(getParameterByName(
'isHybrid'
) ==
"Yes"
) {
// alert("inside first If");
customArg = document.getElementById(
"Latitude"
).value;
//0
// alert("After x Assignment" + customArg);
customArg = customArg +
";"
+ document.getElementById(
"Longitude"
).value;
//1
//alert("After y Assignment" + customArg);
customArg = customArg +
";"
+ map.getCenter();
// 2
//alert("After NA Assignment" + customArg);
customArg = customArg +
";"
+ zoom;
//3
//alert("After ZOOM Assignment" + customArg);
customArg = customArg +
";"
+
"hybrid"
;
//4
//alert("After MAPTYPE Assignment" + customArg);
customArg = customArg +
";"
+ getParameterByName(
'isHybrid'
);
//5
//alert("After IShybrid Assignment" + customArg);
GetRadWindow().close(customArg);
}
else
{
//alert("Entered else");
//alert("X: " + document.getElementById("Latitude").value);
//alert("Y: " + document.getElementById("Longitude").value);
//alert("center: " + getParameterByName("center"));
//alert("zoom: " + getParameterByName("zoom"));
customArg = document.getElementById(
"Latitude"
).value;
//0
customArg = customArg +
";"
+ document.getElementById(
"Longitude"
).value;
//1
customArg = customArg +
";"
+ getParameterByName(
"center"
);
// 2
customArg = customArg +
";"
+ getParameterByName(
'zoom'
);
//3
customArg = customArg +
";"
+
"roadmap"
;
//4
customArg = customArg +
";"
+
"No"
;
//5
GetRadWindow().close(customArg);
this
.Close();
}
}
function
GetRadWindow() {
var
oWindow =
null
;
if
(window.radWindow) oWindow = window.radWindow;
else
if
(window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return
oWindow;
}
function
Close() {
GetRadWindow().close();
}
So if the "Desc" is "true this will go to the else of this code. as you can see at the end i close it
GetRadWindow().close(customArg);
and even emphesize closing it but it works sometimes, what is it that i am doing wrong?
Checked the F12 Error Chrome debugger there is no Error.
Thanks