Select to view content in your preferred language

Link Text displaying in eSearch Popup

1356
7
07-26-2011 02:05 PM
JamesFaron
Frequent Contributor
For some reason the link text displays in the popup of a layer result in the eSearch Widget. Screenshop attached. This is the relevant portion of the eSearch.xml:
<configuration>
 <layers>
  <layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
            <name>Schools</name>
            <url>http://myserver/ArcGIS/rest/services/Maps/DistrictBasemap/MapServer/26</url>
            
            <graphicalsearchlabel>Use one of the graphical search tools to select school</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>SCHOOL</titlefield>
            <linkfield>URL</linkfield>
   <icon isfield="false">assets/images/i_linkglobe1.png</icon>
            <fields all="false">
             <field name="NAME" alias="NAME" gridfield="true"/>
    <field name="FACILITY" alias="Facility" gridfield="true"/>
    <field name="CODE" alias="Code" gridfield="true"/>
    <field name="ADDRESS" alias="Address" gridfield="true"/>
    <field name="ZIP" alias="Zip" gridfield="true"/>
    <field name="CAPACITY" alias="Capacity" gridfield="true" gridfieldonly="true"/>
    <field name="ENROLLMENT" alias="Enrollment" gridfield="true" gridfieldonly="true"/>
    <field name="TEA_2010" alias="TEA 2010" gridfield="true"/>
    <field name="TEA_2009" alias="TEA 2009" gridfield="true" gridfieldonly="true"/>
    <field name="TEA_2008" alias="TEA 2008" gridfield="true" gridfieldonly="true"/>
    <field name="URL" alias="Facility Website" hyperlinkgridfield="true" hyperlinkaliastext="Facility Website" gridfieldonly="true"/>
   </fields>
   <zoomscale>8000</zoomscale>
        </layer>


I want the link icon to work in the result, and it would be great if the icon appeared in the popup. Is there something that I am missing in the xml?

Thanks,
Jim Faron
Tags (2)
0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus
Jim,

   Your issue is that you are are telling the widget that the URL field is only to be show in the grid...

<field name="URL" alias="Facility Website" hyperlinkgridfield="true" hyperlinkaliastext="Facility Website" gridfieldonly="true"/>


Remove the gridfieldonly attribute and that should allow the icon to appear in the results. Your desire to have the icon in the popup is just not going to happen. The popup is controlled by the Flex API and unless you extend the API then you are just stuck the way it is.
0 Kudos
JamesFaron
Frequent Contributor
Robert,

Actually the icon appears in the results even with the gridfieldonly=true. What I would like to do is remove the web address, i.e. the link field value, from appearing in the popup, but retain the icon link in the result, if that is possible.

Thanks,
Jim Faron
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jim,

   No that's not possible. As I stated in my last post the way the popup displays the results is controlled in the API itself and I don't have control over that unless the API's PopUpRenderer component is extended and I don't have any plans to do that for this widget at the current time.
0 Kudos
JamesFaron
Frequent Contributor
Robert,
Thanks for the response, and for this fantastic widget.

I have customized the popup for this layer in the viewer using the viewers new popup configuration, and will look into the code to minimize the pop up behavior for this particular layer in the eSearch widget. It would be a great enhancement at some time to have the capability/choice of turning off or on the popups for a particular layer in the eSearch widget, especially now that the viewer accommodates custom popups via the config popups.

Thanks again for all that you do,
Jim Faron
0 Kudos
JamesFaron
Frequent Contributor
If anyones interested, the fix for the issue that I was (inadequately) describing is as follows: to remove the link text from the eSearch Widget Popup, simply find this line in the searchWidget.mxml
popUpInfo.description += "<br/><a href='{link}'>{link}</a>"

Then, you can hard code as follows, so as affect each search layer differently, if you so choose:
else
     {
     // popUpInfo.description += "<br/><a href='{link}'>{link}</a>"//removed from Roberts original
      if (cboLayerText.selectedLabel == "Schools"){ //added to modify popup link text
       popUpInfo.description += "<br/><a href='{link}'>Facility Website</a>"}
      else if (cboLayerText.selectedLabel == "TCAD Parcels"){ //added to modify popup link text
       popUpInfo.description += "<br/><a href='{link}'>TCAD Website</a>"}
     }
    }
    
    return popUpInfo;
   }


Before image is in my first post, solution image attached to this post. The text Facility Website is now the link, and I have the icon link in the search results.

Thanks,
Jim Faron
0 Kudos
MLowry
by
Frequent Contributor
Well done Jim and thanks for sharing your solution.
0 Kudos
JustinConner
Frequent Contributor
Thanks for sharing your solution.

I noticed that the link would revert back when opening the Data Grid, so be sure to open the SearchWidgetFloat(or Fixed)DG.mxml and edit the same lines of code.
0 Kudos