[mapguide-users] Calling viewer api functions from the main page

A H hizperion at hotmail.com
Mon Jun 9 22:59:54 EDT 2008


well there's no error, so firebug didn't detect anything.


you can try on this,

this is the iframe,

<iframe id="imapframe" frameborder="0" height="600" scrolling="no"
width="800" src="/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=<%=
get_session() %>&WEBLAYOUT=<%= get_layout() %>"></iframe>


and a button,

<input type="button" value="refresh" onclick="test()" />


and the refresh command,

<script type="text/javascript">
    function test()
    {
        parent.imapframe.mapFrame.Refresh();
    }
</script>


i've been googling for some time and still haven't find a solution to make
this work in Firefox.




Kenneth Skovhede, GEOGRAF A/S wrote:
> 
> If you install firebug, you can inspect the code, and examine the 
> objects you are calling:
> http://www.getfirebug.com/
> 
> Next step would be to look at "MapGuide Developers Guide" page 19:
> http://mapguide.osgeo.org/2.0/documentation.html
> 
> You can see how the viewer frames are laid out, and see what 
> "parent.parent" points to.
> Page 18 describes what the frames are for and page 20-25 describe 
> concrete cases.
> 
> Regards, Kenneth Skovhede, GEOGRAF A/S
> 
> 
> 
> A H skrev:
>> sadly this doesn't work in Firefox. have anyone done this in Firefox?
>>
>>
>>
>> uXuf wrote:
>>   
>>> Okay thanks. parent.viewerFrame.mapFrame works like a charm!
>>>
>>> uXuf
>>>
>>>
>>> Ivan Milicevic-3 wrote:
>>>     
>>>> try parent.viewerFrame.mapFrame.Refresh(); od
>>>> window.frames.mapFrame.Refresh();
>>>>
>>>> ________________________________
>>>>
>>>> From: mapguide-users-bounces at lists.osgeo.org on behalf of uXuf
>>>> Sent: uto 8.1.2008 22:43
>>>> To: mapguide-users at lists.osgeo.org
>>>> Subject: [mapguide-users] Calling viewer api functions from the main
>>>> page
>>>>
>>>>
>>>> Hi all, I am trying to access the Viewer API functions from the main
>>>> page
>>>> of my application, i.e. the page that has the WebLayout embedded (or
>>>> the
>>>> iframe). I cannot seem to grab the exact frame from which these
>>>> functions
>>>> would be accessible. I tried using
>>>> document.getElementById("viewerFrame").GetMapFrame() (viewerFrame is
>>>> the
>>>> name of the iframe) putting it in the onload function of the iframe but
>>>> it returns "Object doesn't support this property or method". Can anyone
>>>> help me in this regard? Thanks! uXuf 
>>>>
>>>> ________________________________
>>>>
>>>> View this message in context: Calling viewer api functions from the
>>>> main
>>>> page
>>>> <http://www.nabble.com/Calling-viewer-api-functions-from-the-main-page-tp14699670s16610p14699670.html> 
>>>> Sent from the MapGuide Users mailing list archive
>>>> <http://www.nabble.com/MapGuide-Users-f14845.html>  at Nabble.com.
>>>>
>>>>
>>>>  
>>>> _______________________________________________
>>>> mapguide-users mailing list
>>>> mapguide-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>>
>>>>
>>>>       
>>>     
>>
>>   
> 
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Calling-viewer-api-functions-from-the-main-page-tp14699670p17746775.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list