Microsoft Office Tutorials and References
In Depth Information
it is very important to understand that the Page object in this context is the active web drawing page that is
inside the VWa web part—not the .aspx page.
On the page, you can have one or more shapes that can be retrieved using the ShapeCollection object.
And, finally, you can access the individual shape from the shape collection and its properties.
To use the JavaScript Mashup API and understand it more clearly, let’s begin with a simple exercise.
prOBLeM CaSe
Using the previously created Mall.vsdx, display the details of each monument by clicking the shape.
Create a new page under the site pages, and name it Mall.aspx .
insert a Visio Web access web part, from the Business Data Categories, on the page.
after you add the web part, make sure the page is in edit mode and click the link that says
Click here to open the tool pane .
From the Visio Web access configuration window, choose Mall.vsdx from the Visio Library
document library and click oK.
Click oK on the configuration window.
save and close the page to view the Visio diagram rendered on the web page.
right-click on the browser, click View source on the context menu, and search for the text
Find the corresponding id of the td that you should find just above the div . Usually, it will be
WebPartWPQ2 on a freshly created site page.
open Notepad, and paste the code in Listing 2-1 into it. save this as the file assets.js .
Listing 2-1. Assets.js
<script language="javascript">
var _application = Sys.Application;
var _visioWebPart;
var onShapeSelectionChanged = null;
function onApplicationLoad()
// Change the control id based on the code on your page
_visioWebPart= new Vwa.VwaControl("WebPartWPQ2");
_visioWebPart.addHandler("diagramcomplete", onDiagramComplete);
_visioWebPart.addHandler("shapeselectionchanged", onShapeSelectionChanged);
Search JabSto ::

Custom Search