function setPage(callingNode) {
try {
var vwaControl;
vwaControl= new Vwa.VwaControl(getVWAWebPartID1());
// Get id from calling DOM node and set the corresponding page.
vwaControl.setActivePage(callingNode);
}
catch(err) {
alert(err);
}
}
// Search the SharePoint page to get the WebPartID# for the Visio Web Access Web Part.
function getVWAWebPartID1() {
// Get a NodesList of all the div tags on the page.
var divArray = document.getElementsByTagName("div");
var webPartElementID;
// Iterate through the NodesList to get the node with the class attribute "VisioWebAccess."
for (var i = 0; i < divArray.length; i++) {
var node = divArray[i];
// Return the first instance of the Visio Web Access Web Part.
if (node.className == "VisioWebAccess") {
webPartElementID = node.parentNode.parentNode.id;
break;
}
}
return webPartElementID;
}
Note: Now when ever we want to set particular page name as active, we will just pass the name of the page(visio page) to that script.
Ex:
onclick= "javascript:setPage('visio page sheet name')");
try {
var vwaControl;
vwaControl= new Vwa.VwaControl(getVWAWebPartID1());
// Get id from calling DOM node and set the corresponding page.
vwaControl.setActivePage(callingNode);
}
catch(err) {
alert(err);
}
}
// Search the SharePoint page to get the WebPartID# for the Visio Web Access Web Part.
function getVWAWebPartID1() {
// Get a NodesList of all the div tags on the page.
var divArray = document.getElementsByTagName("div");
var webPartElementID;
// Iterate through the NodesList to get the node with the class attribute "VisioWebAccess."
for (var i = 0; i < divArray.length; i++) {
var node = divArray[i];
// Return the first instance of the Visio Web Access Web Part.
if (node.className == "VisioWebAccess") {
webPartElementID = node.parentNode.parentNode.id;
break;
}
}
return webPartElementID;
}
Note: Now when ever we want to set particular page name as active, we will just pass the name of the page(visio page) to that script.
onclick= "javascript:setPage('visio page sheet name')");