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.
Note
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.
Solution
1.
Create a new page under the site pages, and name it Mall.aspx .
2.
insert a Visio Web access web part, from the Business Data Categories, on the page.
3.
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 .
4.
From the Visio Web access configuration window, choose Mall.vsdx from the Visio Library
document library and click oK.
5.
Click oK on the configuration window.
6.
save and close the page to view the Visio diagram rendered on the web page.
7.
right-click on the browser, click View source on the context menu, and search for the text
class=“VisioWebAccess.”
8.
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.
9.
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;
_application.add_load(onApplicationLoad);
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