Select to view content in your preferred language

Is This Modification to Search Widget (Flex Viewer 2.2) Possible?

2504
17
03-24-2011 07:22 AM
EmilioSolano
Occasional Contributor
Hi,
What I am trying to accomplish, within my limitations, is to link each record(parcel) found with the search tool to the corresponding assessor's map stored in a repository in pdf format. Please see the attached code that was added to one of the uncompiled samples. That was extracted from an old web application. Our PIN configuration is: 4 characters for the mapbook + 3 characters for the map page + 3 characters for the parcel number. The value needed to retrieve the the map will have the first 4 characters, followed by a hyphen (-) and then the 3 characters for the page. It occurred to me that perhaps the portion you described on the Owners Parcels portion that deals with an URL for a hyperlink could be used somehow. Or maybe part of the attached code can be added to the widget source code and the recompile it, for that I would need instructions into how to recompile the widget source code. Any suggestions?
Emilio
Tags (2)
0 Kudos
17 Replies
EmilioSolano
Occasional Contributor
Hi Robert, yes, I finally figure it out (with a lot of help from you!) how to compile and get the xml and swf files. Now the place where I am getting stuck is in making the connection between the table (grid) fields: APN, Owner, Address, etc., with the url+parsed APN:
       APN               NAME             ADDRESS                  ASSESSOR MAP
2004-005-006 | John Q Public | 500 W Temple St | <click here to get map page>?
I do not have a link column in my geodatabase, so I thought that the widget would somehow make the connection between each record and the link perhaps using the APN (assessor parcel number).
That is were I am right now. I think I am as close to make it work as a blinfolded person trying to find a penny in a footbal field. I am just not ready to give up. Thanks for your valuable assistance! I feel that I am wasting your time due to my lack of knowledge in the matter. Emilio
0 Kudos
EmilioSolano
Occasional Contributor
Robert, a portion of my searchWidget.xml looks like this after editing:

<?xml version="1.0" ?>
<!--
See Enhanced Search Widget XML Configuration.pdf for detailed explanation
-->

<configuration>
<layers>
  <layer>
   <name>Parcels</name>
   <enableexport>true</enableexport>
   <url>http://hmapapp-v/ArcGIS/rest/services/Parcels_2010/MapServer/1</url>
   <expressions>
    <expression>AIN='[value]'</expression>
    <textsearchlabel>Search Parcel by AIN [ Example: 2004005006 ]"</textsearchlabel>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select Parcel</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>AIN</titlefield>
   <fields all="false">
    <field name="APN" alias="APN" gridfield="true" />
    <field name="OWNER" alias="Owner's Name" gridfield="true" />
    <field name="HOUSENUM" alias="House" gridfield="true" />
    <field name="STR_NAME" alias="Street Name" gridfield="true" />
    <field name="STR_TYPE" alias="Street Type" gridfield="true" />
    <field name="CITY" alias="City" gridfield="true" />
    <field name="ZIP" alias="ZIP Code" gridfield="true" />
    <field name="TRA_1" alias="Tax Rate Area" gridfield="true" />
    <field name="ZONING" alias="Zoning" gridfield="true" />
    <field name="LBVAL" alias="Base Land Value" gridfield="true" currencyformat="$|2|,|."/>
    <field name="IBVAL" alias="Base Impr Value" gridfield="true" currencyformat="$|2|,|."/>
    <field name="USECODE_1" alias="Use Code" gridfield="true" />
    <field name="TYPE" alias="Use Type" gridfield="true" />
    <field name="URL" alias="Get Map Page" hyperlinkgridfield="true" hyperlinkaliastext="Click here for document" linkprefix="http://maps.assessor.lacounty.gov/mapping/viewAssessorMapPDF.asp?val=" linksuffix=""/>
   </fields>
   <linkfield>AIN</linkfield>
   <icon isfield="true"></icon>
   <zoomscale>5000</zoomscale>
  </layer>
... MORE CODE FOLLOWS

Then a new browser open trying to open the assessor map page but with an error message since it could not find the map page and the url address shows:

http://maps.assessor.lacounty.gov/mapping/viewAssessorMapPDF.asp?val=undefined

as a result. At this point I am totally lost. I attached two images in case they may help to point me in the right direction. Thanks, Emilio.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Emilio,

   You need to look at the example SearchWidget.xml file and read the Enhanced Search Widget XML Configuration.pdf...

   You have a couple of issue in your configuration.

<layer>
<name>Parcels</name>
<enableexport>true</enableexport>
<url>http://hmapapp-v/ArcGIS/rest/services/Parcels_2010/MapServer/1</url>
<expressions>
<expression>AIN='[value]'</expression>
<textsearchlabel>Search Parcel by AIN [ Example: 2004005006 ]"</textsearchlabel>
</expressions>
<graphicalsearchlabel>Use one of the graphical search tools to select Parcel</graphicalsearchlabel>
<spatialsearchlayer>true</spatialsearchlayer>
<titlefield>AIN</titlefield>
<fields all="false">
<field name="APN" alias="APN" gridfield="true" />
<field name="OWNER" alias="Owner's Name" gridfield="true" />
<field name="HOUSENUM" alias="House" gridfield="true" />
<field name="STR_NAME" alias="Street Name" gridfield="true" />
<field name="STR_TYPE" alias="Street Type" gridfield="true" />
<field name="CITY" alias="City" gridfield="true" />
<field name="ZIP" alias="ZIP Code" gridfield="true" />
<field name="TRA_1" alias="Tax Rate Area" gridfield="true" />
<field name="ZONING" alias="Zoning" gridfield="true" />
<field name="LBVAL" alias="Base Land Value" gridfield="true" currencyformat="$|2|,|."/>
<field name="IBVAL" alias="Base Impr Value" gridfield="true" currencyformat="$|2|,|."/>
<field name="USECODE_1" alias="Use Code" gridfield="true" />
<field name="TYPE" alias="Use Type" gridfield="true" />
<field name="PARCELID" alias="Get Map Page" hyperlinkgridfield="true" hyperlinkaliastext="Click here for document" gridfield="true" />
</fields>
<linkfield>PARCELID</linkfield>
<icon isfield="true"></icon>
<zoomscale>5000</zoomscale>
</layer>


The code I provided was based on your old non-Flex Viewer code and you were using the PARCELID field to get the info and transform it into a string you needed for your link.

I also did not send you and code to handle this in the grid. My suggestion is get it working in the info window first then I can help you get it working in the grid.
0 Kudos
EmilioSolano
Occasional Contributor
Hi Robert,
Thank you for your patience. I fixed some quirks on the code. I followed the suggestion of generating an additional field with the book and page the be used in conjuction with the link prefix and sufix. Now, from the grid I can display the corresponding assessor mapbook page. Your comments and ideas were of great value and helped me to complete my project. It might not be perfect but it works. Please keep up your outstanding ideas flowing!
0 Kudos
MeghanMcGaffin
Deactivated User


   You need to look at the example SearchWidget.xml file and read the Enhanced Search Widget XML Configuration.pdf...

  

Where would I find this pdf?  It wasn't in the .zip file.  While I'm asking, does it make a difference if my site is for intranet use only at this point? Thanks!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Meghan,

   It is in the Zip file I just checked the download...

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

Intranet should not matter, but the hyperlink still needs to be a valid URL
0 Kudos
MeghanMcGaffin
Deactivated User
Meghan,

   It is in the Zip file I just checked the download...

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

Intranet should not matter, but the hyperlink still needs to be a valid URL


Ha! I don't have Adobe installed and I was looking for the icon and not the file extension! My bad.  thanks.  You're pretty awesome for making all these cool widgets and being so helpful, thanks a lot!
0 Kudos
EmilyLaMunyon
Deactivated User
Emilio,

  Untested...

Find this code in the SearchWidget.mxml, createSearchResults function:
      if (fieldName.toUpperCase() == queryLinkField.toUpperCase())
      {
       //concatenate
       link = queryLinkPre + value + queryLinkSuffix;
      }


Replace with:
      if (fieldName.toUpperCase() == queryLinkField.toUpperCase())
      {
       if(fieldName.toUpperCase() == "PARCELID"){
        var url:String = "http://maps.assessor.lacounty.gov/mapping/viewAssessorMapPDF.asp?val=";
        var AINlink:String = value;
        var dashes:RegExp = /-/g;
        AINlink = AINlink.replace(dashes, "");
        var spaces:RegExp = / /g;
        AINlink = AINlink.replace(spaces, "");
        AINlink = AINlink.substr(0,4) + "-" + AINlink.substr(4,3);
        url = url + AINlink;
        link - url;
       }else{
        //concatenate
        link = queryLinkPre + value + queryLinkSuffix;
       }
      }


Hello,

I am looking to do something similar (I think) to the esearch widget. I need to be able to pass at least 3 parameters and/or fields in a url, within the esearch datagrid, in order for my map to open pdf images. Something similar to the following:

<a href="http://surveyor.slco.org/gis/map/map_search/mrs_test.cfm?mrspoint={POINT_NAME}&lat={LATITUDE_DD}&long={LONGITUDE_DD}">View Mon. Ref Sheet</a>



Is the code above what I would use in order to accomplish this? If not, is it possible to make this modification to the uncompiled esearch widget?:confused:

Thanks!!
0 Kudos