Select to view content in your preferred language

Search widget  (<linkfield></linkfield>) question

3444
10
04-13-2011 11:17 AM
JerryBiedenbender
Emerging Contributor
How do I get the Linkfield in the search widget to work?

<configuration>
<layers> 
  <layer>
   <name> Stream Gage </name>
   <url>http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_usdata/MapServer/0</url>
   <expression>STAID = '[value]'</expression>
   <textsearchlabel>Search by Station ID  [ Example: 03260100 ]:</textsearchlabel>
   <graphicalsearchlabel>Drag a box to identify the Stream Gage</graphicalsearchlabel>
   <fields>STAID, STANAME, STAGE, TIME,URL, CLASS</fields>
   <titlefield>Stream Gages</titlefield>
   <linkfield></linkfield>
  </layer>
 
   
</layers>
<zoomscale>5000</zoomscale>
</configuration>
Tags (2)
0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus
Jerry,

   Have you tried adding you URL field there?
0 Kudos
JerryBiedenbender
Emerging Contributor
Yes sir, but it seems to try to open up a link from my system instead of following the actual link, I get the following error. (Cannot find 'file:///C:/Documents%20and%20Settings/jbiedenbender/desktop/WebMaps/Flex/Flex_Projects/Final_Web-Apps/SD1/bin-debug/URL'.   Make sure the path or internet address is correct)


Once I publish the app on my server I get the same error but directed towards the holding folder that its in on there.


Jerry
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jerry,

Does your config look like this:

<layer>
<name> Stream Gage </name>
<url>http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_usdata/MapServer/0</url>
<expression>STAID = '[value]'</expression>
<textsearchlabel>Search by Station ID [ Example: 03260100 ]:</textsearchlabel>
<graphicalsearchlabel>Drag a box to identify the Stream Gage</graphicalsearchlabel>
<fields>STAID, STANAME, STAGE, TIME,URL, CLASS</fields>
<titlefield>Stream Gages</titlefield>
<linkfield>URL</linkfield>
</layer>
0 Kudos
JerryBiedenbender
Emerging Contributor
<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright © 2008 - 2009 ESRI
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions.  See use restrictions in the file:
// <install location>/FlexViewer/License.txt
//
////////////////////////////////////////////////////////////////////////////////
-->
<configuration>
 <layers>  
  <layer>
   <name> Stream Gage </name>
   <url>http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_usdata/MapServer/0</url>
   <expression>STAID = '[value]'</expression>
   <textsearchlabel>Search by Station ID  [ Example: 03260100 ]:</textsearchlabel>
   <graphicalsearchlabel>Drag a box to identify the Stream Gage</graphicalsearchlabel>
   <fields>STAID, STANAME, STAGE, TIME,URL, CLASS</fields>
   <titlefield>Stream Gages</titlefield>
   <linkfield>URL</linkfield>
  </layer>
  
    
 </layers>
 <zoomscale>5000</zoomscale>
</configuration>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jerry,

   Which Version of the Flex Viewer are we talking about?
0 Kudos
JerryBiedenbender
Emerging Contributor
I believe I grabbed this code from 1.3
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jerry,

   Not sure what you are doing wrong then as I just tested it using Sample Flex Viewer 1.3 using:

<layer>
   <name> Stream Gage </name>
   <url>http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_usdata/MapServer/0</url>
   <expression>STAID = '[value]'</expression>
   <textsearchlabel>Search by Station ID  [ Example: 03260100 ]:</textsearchlabel>
   <graphicalsearchlabel>Drag a box to identify the Stream Gage</graphicalsearchlabel>
   <fields>STAID,STANAME,STAGE,TIME,URL,CLASS</fields>
   <titlefield>Stream Gages</titlefield>
   <linkfield>URL</linkfield>
  </layer>

And it worked fine. The only change I made was removing the spaces in between the field names and the commas.
0 Kudos
JerryBiedenbender
Emerging Contributor
Do you think it might have something to do with my mxml file?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jerry,

    Yep,   You definitely changed a line in the code that wasn't suppose to be changed.

Line 396 in the StreamGages.mxml is suppose to be:
link = value;
0 Kudos