Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just did something similar. You can use the shapeSelectionChangedHandler to handle clicks to. As far as I know there is no onClick functionality, but shapeSelectionChangedHandler works fine for me. </p> <p>See: <a href="https://stackoverflow.com/questions/15633916/programming-with-visio-in-sharepoint-need-to-add-the-logic-in-javascript">Programming with Visio in SharePoint, create new Outlook meeting in ?Javascript?</a></p> <p>See: <a href="http://msdn.microsoft.com/en-us/library/gg243427.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/gg243427.aspx</a> for guide to set it up with Content WebPart and so on.</p> <p>Code I use, just add what you want in <code>shapeSelectionChangedHandler = function(source, args) {}</code></p> <pre><code>&lt;script language="javascript"&gt; var app = Sys.Application; app.add_load(onApplicationLoad); // hold an instance of the Visio VWA control var vwaControl; var shapeSelectionChangedHandler = null; function onApplicationLoad() { vwaControl= new Vwa.VwaControl("WebPartWPQ4"); vwaControl.addHandler("diagramcomplete", onDiagramComplete); vwaControl.addHandler("shapeselectionchanged", shapeSelectionChangedHandler); } function onDiagramComplete() { var vwaPage = vwaControl.getActivePage(); vwaPage.setZoom(35); // force the initial zoom level } shapeSelectionChangedHandler = function(source, args) { // get the selected shape from the shapes on the page var vwaPage = vwaControl.getActivePage(); var vwaShapes = vwaPage.getShapes(); var shape = vwaShapes.getItemById(args); // get the data to display for the selected shape var data = shape.getShapeData(); var strRoomName = ""; var strFloorNumber = ""; var strCapacity = ""; var strStatus = ""; for (var j = 0; j &lt; data.length; j++) { if (data[j].label == "RoomName") { strRoomName = data[j].value; continue; } if (data[j].label == "FloorNumber") { strFloorNumber = data[j].value; continue; } if (data[j].label == "Capacity") { strCapacity = data[j].value; continue; } if (data[j].label == "RoomStatus") { strStatus = data[j].value; continue; } } // get the selected state input and set its value var inputRoomName = document.getElementById('strRoomName'); inputRoomName.value = strRoomName; var inputFloorNumber = document.getElementById('strFloorNumber'); inputFloorNumber.value = strFloorNumber; var inputCapacity = document.getElementById('strCapacity'); inputCapacity.value = strCapacity; var inputStatus = document.getElementById('strStatus'); inputStatus.value = strStatus; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload