[mapguide-users] How to embed the website into the widget?

Chris Claydon chris.claydon at autodesk.com
Fri Mar 20 18:22:01 EDT 2009


So, if I understand correctly, you want to add a button to a flexible web layout that will launch a website in a new browser window?

You should be able to do that really easily using an InvokeScript widget. Just set the script to be something like: window.open('http://mapguide.osgeo.org', null);

If you have a copy of MapGuide Studio, it should be easy to create the new widget using the UI.
If you don't have MapGuide Studio, here's the XML for the widget instance:

    <Widget xsi:type="UiWidgetType">
      <Name>LaunchMGWebsite</Name>
      <Type>InvokeScript</Type>
      <Location />
      <Extension>
        <Script>window.open('http://mapguide.osgeo.org', null);</Script>
        <Target />
      </Extension>
      <ImageUrl />
      <ImageClass />
      <Label>MG Website</Label>
      <Tooltip />
      <StatusText />
      <Disabled>false</Disabled>
    </Widget>

(That needs to go into the <WidgetSet> section of the flexible web layout definition)

Then you just need to reference it from one of your toolbars, e.g.

      <Item xsi:type="WidgetItemType">
        <Function>Widget</Function>
        <Widget>LaunchMGWebsite</Widget>
      </Item>

(That needs to go into the <Container> corresponding to the toolbar.)

e.g. for the 'ToolbarSecondary' toolbar...

    <Container xsi:type="UiItemContainerType">
      <Name>ToolbarSecondary</Name>
      <Type>Toolbar</Type>
      <Position>top</Position>
      <Extension />
      <Item xsi:type="WidgetItemType">
        <Function>Widget</Function>
        <Widget>LaunchMGWebsite</Widget>
      </Item>
      <Item xsi:type="WidgetItemType">
        <Function>Widget</Function>
        <Widget>Select</Widget>
      </Item>
      <Item xsi:type="WidgetItemType">
        <Function>Widget</Function>
        <Widget>Pan</Widget>
      </Item>
Etc, etc, etc.

I hope that helps,

Chris.

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of achectl
Sent: Thursday, March 19, 2009 10:02 AM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] How to embed the website into the widget?


Hi All,

Can the widget (Flexible web layout) be embedded a website? I would like to
make a button, it will used for opening a widget. The widget will open and
display the website. Can it do that? Thanks in advance.


Achectl
-- 
View this message in context: http://n2.nabble.com/How-to-embed-the-website-into-the-widget--tp2503767p2503767.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


More information about the mapguide-users mailing list