[mapguide-users] Can anyone tell me why I can't do a refresh
gunter.becker at CSOGIS.DE
Fri Dec 14 17:18:15 EST 2007
could it be that your code runs in another domain than the AjaxViewer. For
example when your code runs on your develop machine and the AjaxViewer
(WebExtensions) runs on another computer on your intranet you will have a
security issue. You cannot access the methods in another frame via scripting
when it is located in another domain. I ran into this problem and got the
same error saying object or method does not exist.
> to do the refresh. If I place an html button in the page and execute
> parent.parent.mapFrame.refresh(); It refreshes the map with my group
> turned off. For some reason, when I execute the sub as shown below,
> parent.parent.mapFrame is not valid but parent.mapFrame is. Same page as
> the html button but obviously executed differently. The debugger shows
> that parent is viewFrame in this context and parent.mapFrame is valid.
> However, the refresh throws an error saying object or method does not
> exist. I feel like I'm missing something obvious but cannot discover what
> it is. Anyone have any help.
> Thanks in advance.
> Protected Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e
> As System.EventArgs)
> Dim mySiteConnection As New MgSiteConnection
> Dim myUserInfo As New
> Dim myFeatureService As MgFeatureService =
> Dim myResourceService As MgResourceService =
> Dim myMap As New MgMap
> myMap.Open(myResourceService, m_CurrentMap())
> Dim myLayerGroup As MgLayerGroup = Nothing
> Dim myLayerGroups As MgLayerGroupCollection = myMap.GetLayerGroups
> Dim i As Integer = 0
> For Each myLayerGroup In myLayerGroups
> If myLayerGroup.Name = "Group1" Then
> End If
> Dim myKey As String = "mapRefresh"
> If Not Page.ClientScript.IsStartupScriptRegistered(Me.GetType,
> myKey) Then
> Dim myScript As String = "parent.mapFrame.refresh();"
> Page.ClientScript.RegisterStartupScript(Me.GetType, myKey,
> myScript, True)
> End If
> End Sub
View this message in context: http://www.nabble.com/Can-anyone-tell-me-why-I-can%27t-do-a-refresh-tp14339775s16610p14339828.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users