Select to view content in your preferred language

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

2232
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
RobertScheitlin__GISP
MVP Emeritus
Emilio,

   You could do this without changing any code IF you had a field that contained the AINlink data already formatted (say using field calculator in ArcMap). If you do what to do the data manipulation in code than let me know and I will show you where to put your code in the eSearch source code.
0 Kudos
EmilioSolano
Occasional Contributor
Robert,

I am willing to try both approaches. We have a large county (2.4 million parcels) and we create about 21,000 new parcels on a slow year, for that reason I want to present to upper management these two choices. Please indicate what do I have to do. My email is esolano@assessor.lacounty.gov

Thank you very much.
Emilio
0 Kudos
EmilioSolano
Occasional Contributor
Robert,

Could you, if time allows you to do it, please indicate to me where to place the code I sent you and indicate the steps to recompile the widget? I will greatly appreciate your assisstance. Thanks.
Emilio
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
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;
       }
      }
0 Kudos
EmilioSolano
Occasional Contributor
Thanks Robert, I will try it and let you know what happens after recompiling the widget. Emilio
0 Kudos
EmilioSolano
Occasional Contributor
Robert, this is what I did:

1- I took the eSearch widget from ESRI�??s gallery (latest version)
2- Made changes to the un-compiled source code (for 2.2)
3- Copied the modified  widget source code under the widget�??s directory in the ArcGIS Viewer  for Flex 2.2 un-compiled source code
4- Zipped that ArcGIS Viewer for Flex 2.2 un-compiled source code
5- Imported the zipped project into Flash Builder 4
6- Rebuilt the project
7- Exported it to a new location

When I looked for the modified widget the eSearchwidget.xml file was there but no eSearchwidget.swf, perhaps the source files for the widget were incomplete.

Sorry to bother you with this trivial issues, it is just that for me are important. Thanks again. Emilio
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Emilio,

  Between steps 5 and 6 you needed to add the eSearch widget to the flex viewer projects modules list before a swf will be created. See the readme.txt file.
0 Kudos
EmilioSolano
Occasional Contributor
Hi Robert, probably I did all the steps the wrong way: First I made the changes to the eSearch mxml source code, then I imported the viewer code from a zip file into Flash Builder 4. Using copy/paste I then copied the eSearch folder under the viewer src/widgets. After that I selected Project/Build Project followed by Project/Export Release Build with the following settings: Application- All applications, did not check Enable view source, and finally Export to bin-release. Thanks. Emilio.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Emilio,

   So did you get it to compile now? If not did you add it to the flex projects modules list like I mentioned in the last post?
0 Kudos