HOW TO
The "Customizing Java Viewer" PDF document, which is installed with ArcIMS, lists the steps for adding hyperlink-like functionality in an ArcIMS Java Viewer. This article includes additional information about using hyperlinkPrefix and hyperlinkSuffix variables, similar to the HTML Viewer's hyperlink functionality.
Code:
<html>
<head>
<SCRIPT type=”text/javascript” language=”JavaScript”>
// Designer will set the next variable - theTitle
var theTitle = “San Francisco Museums”;
if (theTitle.indexOf(“###TITLE##”)!=-1) theTitle = “ArcIMS Java Viewer”;
document.writeln(“<TITLE>” + theTitle + “</TITLE>”);
var hyperLinkLayers = new Array();
var hyperLinkFields = new Array();
var hyperLinkPrefix = new Array();
var hyperLinkSuffix = new Array();
hyperLinkLayers[0] = “museums”;
hyperLinkFields[0] = “WEBSITE”
hyperLinkPrefix[0]= "/gisdata/world/images/";
hyperLinkSuffix[0] = ".jpg";
</script>
<script language=”javascript” src=”default.js”>
</script>
</head>
Code:
if (parent.useShowSelect) {
document.write(‘<td align=”center” valign=”middle”>’);
// Choose between the following two calls.
// The next line will display attributes of selected features in an HTML table; this is slower but can be customized easily.
document.write(‘<img src=”images/attributes_1.gif” width=16 height=16 hspace=0
vspace=1 border=0 alt=”Attributes” onmousedown=”showSelect(\’\’);”
onmouseover=”window.status=\’Attributes\’”>’);
// The next line will display attributes of selected features in a Java table; this is faster but cannot be customized.
document.write(‘<img src=”images/attributes_1.gif” width=16 height=16
hspace=0 vspace=1 border=0 alt=”Attributes” onmousedown=”displayAttributes(\’\’);”
onmouseover=”window.status=\’Attributes\’”>’);
isSecond = !isSecond;
document.writeln(‘</td>’);
if (isSecond) document.write(‘</tr><tr>’);
}
Code:
if (k > -1) {
// Layer has hyperlink - check to see if this field is the one to use.
if (theFields[j] == parent.hyperLinkFields[k]) {
// This is the hyperlink field...use value as URL.
thisValue=parent.hyperLinkPrefix[k]+ thisValue + parent.hyperLinkSuffix[k];
sendValue = sendValue + "<a href='" + thisValue + "'>" + thisValue + "</a></font></td></tr>";
}
else {
// This isn't the field to use for a hyperlink...just show data.
sendValue = sendValue + thisValue + "</font></td></tr>";
}
Note:
See "Using Hyperlinks" in the "Customizing Java Viewer" document for more information about hyperlink-like functionality in Java Viewer.
Get help from ArcGIS experts
Download the Esri Support App