Database Reference
In-Depth Information
Figure 4-43. Interacting with the VWA web part and the drawing using the JavaScript
Mashup API
now that you have successfully created a simple JavaScript mashup with a Visio
diagram, let's understand the code. One of the major reasons that JavaScript was
chosen to build the API is because of its simplicity.
Understanding the assets.js Code
First, we need to get to the application object and create the event handler for the
application load:
_application.add_load(onApplicationLoad);
Once the application loads, we get the instance of the Visio web access from the
page and add two more event handlers—one when the diagram completes loading
and the other when the shape selection is changed. In the life cycle of these events, the
onDiagramComplete event fires first, and onShapeSelectionChanged is the last event:
_visioWebPart= new Vwa.VwaControl("WebPartWPQ2");
_visioWebPart.addHandler("diagramcomplete", onDiagramComplete);
_visioWebPart.addHandler("shapeselectionchanged", onShapeSelectionChanged);
 
Search WWH ::




Custom Search