Select to view content in your preferred language

Custom eSearch Graphic Tool Not Resetting

1128
5
04-19-2017 11:58 AM
deleted-user-FTxtuSQd67Ur
Deactivated User

I have used Robert's Enhanced Search widget to create a custom widget that sends data to the Print widget if a feature is selected.

There are cases where the user would like to use the graphical search tab to draw a box around a point, which is fine.  The graphic works fine by itself if you use it back to back, but the problem occurs after you use the Print function.  After you Print, you cannot go back into the graphical search bar and re-select a shape, which means the user has to refresh the page and then re-select another point, print, refresh page, select, print, etc. (very cumbersome!).  Is there a part of the code that I am missing that is not releasing that data or not re-engaging the eSearch to function after the data has been sent?

I am a relative JavaScript novice so any snippets of code or such would be truly helpful.

Thanks!

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Can you duplicate this in the original eSearch widget?

0 Kudos
deleted-user-FTxtuSQd67Ur
Deactivated User

Robert,

I have not been able to get it to work in the older eSearch versions as well as this updated one.  If it helps, here is the URL to the app we are using it for. ArcGIS Web Application 

We use the search to draw a box around a point, then print out and address change letter, and then when you go back to the eSearch to draw another box it does not function properly.

This is using the older eSearch/Print widgets but again the problem persists in the new web app I have created to update this one, I have just not put it in production yet.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Carissa,

   Your error stems from some of your customization of the eSearch widget.

           //Begin GIS Customization
           onReceiveData: function(name, source, params,historyData) 
           {
                 this.letterArray.push({"Parcel_ID":params.parcel.parcel_id});

Line 4 is what errors when you try to re-select a draw tool after printing. You need to check for params.parcel (since it is null in this case) before you try and get a property of params.parcel.

0 Kudos
deleted-user-FTxtuSQd67Ur
Deactivated User

Robert,

This code you have above is in the Print widget (widget.js), so I need to make corrections there?

Thanks!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Correct I meant print widget not eSearch.