Vwa.VwaControl.hideCustomMessage Method
Letzte Änderung: Samstag, 6. August 2011
Gilt für: apps for SharePoint | SharePoint Server 2013
Blendet die benutzerdefinierte Entwickler bereitgestellter HTML-Fehlermeldung und neu ermöglicht die Interaktion mit der aktuell gerenderte Seite Webzeichnung.
var value = VwaControl.hideCustomMessage()
Rückgabewert
Void Gibt Nothing zurück.
Hinweise
Weitere Informationen zum Hinzufügen eines Visio Web Access-Webparts zu einer SharePoint-Webparts-Seite finden Sie unter Customizing Visio Web Drawings in the Visio Web Access Web Part.
Beispiel
Das folgende Beispiel zeigt die Webpart-ID des Visio Web Access-Webpart und die URL der Webzeichnungsdatei im Webpart angezeigt.
<script type="text/javascript">
// Hook into the AJAX Sys.Application.load event.
Sys.Application.add_load(onApplicationLoad)
// Define global variables.
var vwaControl;
var webPartElementID;
// Capture a reference to the current session of the Visio Web Access Web Part.
function onApplicationLoad() {
try{
webPartElementID = getVWAWebPartID();
vwaControl= new Vwa.VwaControl(webPartElementID);
vwaControl.addHandler("diagramcomplete", onDiagramComplete);
}
catch(err){
alert(err);
}
}
// Search the SharePoint page to get the WebPartID# for the Visio Web Access Web Part.
function getVWAWebPartID() {
// 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;
}
// Capture references to global variables.
function onDiagramComplete() {
try{
// Get the URL for the drawing currently displayed in the Visio Web Access Web Part.
var drawingURL = vwaControl.getDiagramUrl();
// Display a custom message with the Visio Web Access Web Part ID and drawing URL.
vwaControl.displayCustomMessage(
"<b>Visio Web Access Web Part ID is:</b> " + webPartElementID + "<br>" +
"<b>Diagram was loaded from:</b> " + drawingURL + "<br><br>" +
"<a href='javascript:hideMessage()'>" +
"Click here to dismiss this message<\/a>");
}
catch(err){
alert(err);
}
}
// Hide the message when the user is done with it.
function hideMessage(){
try{
vwaControl.hideCustomMessage();
}
catch(err){
alert(err);
}
}
</script>