7

We are displaying a Visio 2013 document (.vsdx) in a Visio Web Access webpart on a SharePoint 2013 page.

The hyperlinks in the Visio file now reqire that the user click both Ctrl+Click to navigate to the url. I need the users to be able to follow the link using singleclick like they were used to in SharePoint 2010 with Visio Web Drawings. Does anyone know how this can be done in SP 2013/Visio 2013?

Regards ElinK

  • did You found any solution to this problem. I´m facing the same issue :( Thanks, Daniel – user17185 May 23 '13 at 9:51
  • Yup, I also need an answer to this :( – CLockeWork Aug 30 '13 at 14:02
3

I found a solution for this problem. I added JavaScript code to my page that ovverrides the click events of the shapes in the Visio Web Access webpart.

My script is not generic, it only works on pages where the Visio Web Access webpart id is "WebPartWPQ2" so you might have to change it, but I Guess it can help you anyway:

<script type="text/javascript"> 
Sys.Application.add_load(onApplicationLoad); 
var webPartElementID = "WebPartWPQ2"; // The HTML tag ID of the  

// Visio Web Access Web Part. 
var vwaControl; // The Visio Web Access Web Part. 
var vwaPage; // The current page. 
var vwaShapes; // The collection of all the shapes on the current page. 

function onApplicationLoad() 
{ 
try{  
vwaControl= new Vwa.VwaControl(webPartElementID); 
vwaControl.addHandler("diagramcomplete", onDiagramComplete); 
vwaPage = vwaControl.getActivePage(); 
// Firefox special 
if (vwaPage != null) 
{ 
vwaPage.setZoom(-1); 
vwaShapes = vwaPage.getShapes(); 
vwaControl.addHandler("shapeselectionchanged", onShapeSelectionChanged); 
} 
} 
catch(err){ 
alert(err); 
} 
} 

function onDiagramComplete() 
{ 
try{ 
vwaPage = vwaControl.getActivePage(); 
vwaPage.setZoom(-1); 
vwaShapes = vwaPage.getShapes(); 
textArea = document.getElementById('MouseOutput'); 
vwaControl.addHandler("shapeselectionchanged", onShapeSelectionChanged); 
} 
catch(err){ 
alert(err); 
} 
} 

onShapeSelectionChanged = function (source, args) 
{ 
// Don't process the shapeselectionchanged event raised when 
// the selection was cleared (for example, when the user tabs out of the drawing page). 
try{ 
if (vwaShapes.getItemById(args).getHyperlinks().length > 0) 
{ 
var link = vwaShapes.getItemById(args).getHyperlinks()[0].value; 
if (link !=null) 
{ 
location.href=link; 
} 
} 
} 
catch(err){ 
alert(err); 
} 
} 
</script>
  • This also solved my problem with links not working properly in IE 11. Thank you! – vaindil Jun 9 '14 at 19:31
  • Good Job, but I have around 250 Pages with a Visio web Access web part. All pages in one Site Collection, is there an way to get the code in, with out open all 250 pages and add a Content Editor Web Part? Thanks and take care – user39103 Jan 28 '15 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.