Flex Viewer 3 pop-up hyperlinks not working

10568
22
07-11-2012 10:23 AM
KellyPhipps
New Contributor III
I've configured a popup with a hyperlink in the Flex Viewer 3.0 app, but the hyperlink does not work.  The URL that is referenced in the href is getting appended to the url of the of the mapping application.  For example, if my popup has a hyperlink to "www.yahoo.com", clicking the hyperlink will try to open http://myserver/myFlexViewerApp/www.yahoo.com

Hyperlinks in pop-ups worked fine in previous versions of the viewer.  Why are they acting differently with the 3.0 viewer?

Below is an the config for a sample popup (as defined with the application builder) that works fine in viewer 2.3, 2.5, but does not work in 3.0.  Any ideas would be much appreciated.

<?xml version="1.0" ?>
<configuration>
<title>{TITLE}</title>
<description>
<![CDATA[
{NAME}
{ADDRESS}
<a href="www.yahoo.com">Example URL Link</a>
]]>
</description>
</configuration>
Tags (2)
0 Kudos
22 Replies
AnthonyGiles
Frequent Contributor
Kelly,

try putting http:// (e.g. http://www.yahoo.com) in front of your URL and see if that works

Regards

Anthony
0 Kudos
KellyPhipps
New Contributor III
Anthony,

Thank you, that takes care of that issue.  However, I'm experiencing the same problem with hyperlinking to a UNC file path.  I see the exact same behavior that I was seeing with the url, but now I'm trying to hyperlink to a file via UNC path.

For example:  file path attribute = \\myserver\fileshare\filename.tif

Results after clicking on hyperlink give me that file path appended to the end of the app url.

the config hyperlink looks like this:

<a href="{FILEPATH}">Image Link</a>

Again, this worked in previous versions of the viewer/api, but not in 3.0.  Any ideas?

Thanks again for the solution with the URL.

Kelly
0 Kudos
AnthonyGiles
Frequent Contributor
Kelly,

You could try prefixing the UNC path with file:// but I'm not sure if this will work. The best solution would be to make a virtual directory in IIS to your images folder then use a normal URL to the image

Regards

Anthony

P.S. another possible solution is file://///myserver/fileshare/filename.tif (yes thats 5 slashes at the beginning and change your back slashes to forward slashes)
0 Kudos
AdamRepsher
Occasional Contributor III
Anthony,

Thank you, that takes care of that issue. However, I'm experiencing the same problem with hyperlinking to a UNC file path. I see the exact same behavior that I was seeing with the url, but now I'm trying to hyperlink to a file via UNC path.

For example: file path attribute = \\myserver\fileshare\filename.tif

Results after clicking on hyperlink give me that file path appended to the end of the app url.

the config hyperlink looks like this:

<a href="{FILEPATH}">Image Link</a>

Again, this worked in previous versions of the viewer/api, but not in 3.0. Any ideas?

Thanks again for the solution with the URL.

Kelly


Kelly,

With your example: file path attribute = \\myserver\fileshare\filename.tif, the following code worked in only the Application Builder 3.0:
<a href="file:{FILEPATH}" target='_blank'>Image Link</a>



That opens another browser window with the image.

I am still trying to figure this out in the PopUp.xml files in the stand-alone Flex Viewer. The one difference between the two is that the Application Builder does not use the <=!=[=C=D=A=T=A=[ ... ]=]=> wrapper....

EDIT:
I just found out that the above code works in IE7 but not in IE8.  There are lots of posts about this issue with IE8 out there on the web but no answers that have worked yet for me!
0 Kudos
JaroslawWalasztyn
New Contributor
How to add link with UNC path to directory?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

  UNC paths are for INTRANET and not intended for internet... I know some of you are saying well my Flex Viewer app is only used in my intranet, but it is an http internet application... Setup a virtual directory in IIS so that you have a real url to use.
0 Kudos
ErikBlake
Occasional Contributor III
So I am new to Application Builder and I am trying to get our engineering drawings, sewer tap, water tap records that are linked to our water,sewer lines and parcels hyperlinked. I have been trying to duplicate what has been disscused in this thread. However I have a question or two.
So I have created an Application. I have also set-up a virtual directory to where all our drawings are in our IIS. But still can't seem to get my app to go to the folder where our drawings are. We already have fields created within our data called "hyperlink" which has the pdf file name for that individual parcel. (i.e. 9999 somewhere St.pdf) Then we have a field called "HYLNK_RDR" which has the full path name to the folder and subfolder where those drawings are. (i.e. drive name:\folder name\sub folder name\9999 somewhere St.pdf). Do I need to change the value in our "HYLINK_RDR" field to be pointing at a different location. I have little to no programming experience so I am learning the jargon and the do's and dont's has I go along. If anybody has an example of a  code that might advance me a little further that would be sweet. maybe I am just not typing in the correct path. Any suggestions would be awesome. Or even if someone knows of a resource that I can read to help me would be great to. Thanks
Erik.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Erik,

*******EDIT**********
Sorry I missed the fact that you were asking about PDFs and not images. I will post shortly something more specific to your inquiry!
*********************

   So lets take this traffic camera popup as an example:

<?xml version="1.0" ?>
<configuration>
    <title>{DESCRIPTION}</title>     
    <fields>
        <field name="DESCRIPTION" visible="true"/>                
        <field name="ONLINE" visible="true"/>       
        <field name="LAST_UPDATED" visible="true">
            <format dateformat="shortDate"/>
        </field>  
        <field name="URL" visible="true"/>
    </fields>
    <medias>
        <media type="image" caption="Latest Image {LAST_UPDATED} online: {ONLINE}" imagesource="{URL}" imagelink="{URL}"/>
    </medias> 
</configuration>

<!--
    Pop-up configuration file for:
    http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2
-->


The important part is the media element. Your would possible look something like this.
<media type="image" caption="sewer tap {Your_SewerTap_ID_Field}" imagesource="http://yourWebServerURL/YourVirtualDirectory/{hyperlink}" imagelink="http://yourWebServerURL/YourVirtualDirectory/{hyperlink}"/>


Notice in the imagesource and the image link you manually add the url from you virtual directory as a prefix to the hyperlink field value. There is no need to change the HYLINK_RDR field values unless the virtual directory changes based on the feature you are selecting. Hope this gets you going in the right direction.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Erik,

  Here is a better example:

<?xml version="1.0" ?>
<configuration>
    <title>{DESCRIPTION}</title>     
    <fields>
        <field name="DESCRIPTION" visible="true"/>                
        <field name="ONLINE" visible="true"/>       
        <field name="LAST_UPDATED" visible="true">
            <format dateformat="shortDate"/>
        </field>  
        <field name="URL" visible="true"/>
    </fields>
    <description>
        <![CDATA[<p>Sewer Tap: {DESCRIPTION}</p><p>Online: {ONLINE}</p><p>Last Updated: {LAST_UPDATED}</p><p><a href='http://YOUR_WEB_SERVER/YOUR_VIRTUAL_DIRECTORY/{URL}' target='_blank'>View PDF</a></p>]]>
    </description>
</configuration>

<!--
    Pop-up configuration file for:
    http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2
-->


With this example you have to know a tiny amount to HTML coding.
0 Kudos