Hyperlinks not working from shapes using Visio Viewer

I

Ianb

I am building a web interface to display process flows. Each page is a set of
frames with a banner, a table of contents and the body page containing some
html and a visio viewer.

The Visio viewer in the body frame is used to display the process flows.
Each process flow contains shapes that have hyperlinks back to the same html
page in the same frame (Body) .The process flow reference is defined in the
querystring and the Visio Viewer source is set using Javascript.

For some reason when a user clicks on a shape (linking to another process
flow) I gat a message box that says "This file may contain potentially unsafe
content. Do you want to continue opening?"

After clicking OK nothing else seems to happen. If I then refresh the page
the process flow that should have come up appears in the Viewer.

I did a small chech to see if the page was being accessed at all. I put some
Javascript to generate a message box if the page was geretated and this did
not get activated untill teh page was refreshed (as previous)

Does anyone have any ideas?

I should say that it all worked fine before I put the system into frames (to
get around other issues)

Thanks

Ianb
 
M

Michel LAPLANE

I think you can also investigate in creating your visioviewer application in
emberding the visio control viewer as if you had a Visio ActiveX Control.
The non documented object model can help you to enhance the Visio Viewer
Behavior.
 
I

Ianb

Hi

The hyperlinks I am using are in the shapes and as I understand it these are
supported.

I have used a workaround that I though I would publisize. The issue only
occurred because I the hyperlinks were accessing the same page (with a
different querystring parameter - being the name of the visio document). My
nasty little workaround is as folows

The hyperlink calls another page name with the name of the visio document in
a querystring variable. this page uses Javascript to redirect to the actual
page.

One issue was that when a user uses the back button of course they get
redirected to where they came from so I put some code in to trap this and
programmatically navigate the user one more bage back in history.

here is the code for reference (special thanks to those who provided various
messages and blogs from whom I have liberated and stitched the solution)

<html>
<head>
<script type="text/javascript">
<!--
// Gets all variables from the querystring and places them into an array
function getQueryString()
{
var url = unescape(document.location.href);
var qs = new Array();
var temp = new Array();
if (url.indexOf("?") > -1) {
var vars = url.split("?");
vars = vars[1].split("&");
for(i=0; i<vars.length; i++) {
qs[vars.split("=")[0]] = vars.split("=")[1];
}
return qs;
}

function handleBackButton(){
isBack = (x != document._mine._a1.value);
document._mine._a1.value=2;
document._mine._a1.defaultValue=2;
if(isBack) {// back button used go back one page in history
window.history.back();
} else { //back button not used redirect to page requested
window.location = "Process Flow.htm?f=" + sPgAttrib;
}
}
//------------------------------------------------------
// Define file attributes
// Store all querystring values into an array
var qvars = getQueryString();
var sPgAttrib = qvars['f']; // f is the visio file name in the querystring
var x="1";
// -->
</SCRIPT>
</head>

<BODY ONLOAD="handleBackButton()">
<FORM NAME="_mine">
<INPUT NAME="_a1" VALUE="1" STYLE="visibility:hidden">
</FORM>

</body>
</script>
</html>
 
I

Ianb

Hi Michel

I have pretty well managed to resolve this probelm but I am interested in
your comments as my users currently have to activate the viewer before being
able to click a hyperlink in a visio document. If I install it as an ActiveX
component then its API will be visible and I'm hoping I can find a method to
activate the viewer when the page loads. The viewer is not currently in my
list of ActiveX components. Can you explain how I can install the viewer as
an ActiveX component

Thanks

Ian B
 
I

Ianb

Hi

I have reworked this workaround and now it is less complicated, the back and
forward buttons work fine and the page "intermediary" page does not appear in
the browser history. Code follows:

<html>
<head>
<script type="text/javascript">
<!--
function getQueryString() {
var url = unescape(document.location.href);
var qs = new Array();
if (url.indexOf("?") > -1) {
var vars = url.split("?");
vars = vars[1].split("&");
for(i=0; i<vars.length; i++) {
qs[vars.split("=")[0]] = vars.split("=")[1];
}
}
return qs;
}

//Main code ------------------------------------------------------
// Store all querystring values into an array
var qvars = getQueryString();
// Get pagename from querystring vars
var sPgAttrib = qvars['PageName'];
// Go to appropriate page
window.location.replace("GenericPage.htm?PageName=" + sPgAttrib);

// -->
</script>
</head>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top