Date Range Search Expression Advanced eSearch Widget

3208
11
Jump to solution
06-12-2012 10:46 AM
ChristopherBlinn1
Occasional Contributor III
Hello All,

This is just a general question for other GIS Developers who have worked with Robert's eSearch widget for the Flex Viewer.

I have been customizing the eSearch to meet our web application needs, and I am about to attempt another major customization.

I am looking to create a search by date range function that will allow the user to select a start/end date, and then additionally select a drop down attribute value (optional).

For example, think of crimes.  I am wanting a way that the end user can first select the Crimes Layer, select a date range, then have the option to select a crime type, for instance Arson Crimes.  So if the user chose a start date of 3/1/2012 and an end date of 3/30/2012, and then also selected Arson from the Crime Type drop down, then only Arson crimes in March 2012 would be displayed.

Has anyone been working on doing something similar?

My idea is that I will create the date range selection tool, and make it visible when Crimes are the selected layer.  Then build the SQL function so that if the date range and crime type have values, the appropriate AND statement is constructed.

I'm just looking for any tips from developers who have attempted or successfully completed a similar task.  Not necessarily looking for sample code.  Just brainstorming, really.

Thoughts?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Christopher,

  One of my 2012 Dev Summit presentations included code and a widget for crime mapping exactly what you are talking about. It is not a mod for the eSearch it is a completely new widget, but you could glean all the basics from it. The biggest thing is SQL date ranges are a nightmare but setting a time extent works beautifully.

http://gis.calhouncounty.org/devsummit2012/devsumit2012.zip

View solution in original post

0 Kudos
11 Replies
ChristopherBlinn1
Occasional Contributor III
For a little more clarification, I am wanting to use the DateChoose Controls to select the start/end dates.
0 Kudos
AnthonyGiles
Frequent Contributor
Christopher,

Are you using the latest esearch widget that Robert posted up last week:

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

This now allows you to search on multiple fields so you could set up crime type, start date and end date

Regards

Anthony

PS: missed your second post about DateChoose controls, this is something that you would have to program your self as Roberts widget is set up to use input fields, but it is a good place to start
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Christopher,

  One of my 2012 Dev Summit presentations included code and a widget for crime mapping exactly what you are talking about. It is not a mod for the eSearch it is a completely new widget, but you could glean all the basics from it. The biggest thing is SQL date ranges are a nightmare but setting a time extent works beautifully.

http://gis.calhouncounty.org/devsummit2012/devsumit2012.zip
0 Kudos
ChristopherBlinn1
Occasional Contributor III
PS: missed your second post about DateChoose controls, this is something that you would have to program your self as Roberts widget is set up to use input fields, but it is a good place to start



I definitely plan on programming it myself.  I first just wanted to get some input from others.
0 Kudos
ChristopherBlinn1
Occasional Contributor III
Christopher,

  One of my 2012 Dev Summit presentations included code and a widget for crime mapping exactly what you are talking about. It is not a mod for the eSearch it is a completely new widget, but you could glean all the basics from it. The biggest thing is SQL date ranges are a nightmare but setting a time extent works beautifully.

http://gis.calhouncounty.org/devsummit2012/devsumit2012.zip


I sometimes wonder if you have figured it all out, Robert!

Thanks for the file, it will come in very handy!
0 Kudos
ChristopherBlinn1
Occasional Contributor III
All,

I got the eSearch widget to work with a date range.  It actually was pretty simple.

I added the date selector controls and a conditional statement which checks to see if the date range is selected, and then concatenates to the eVal variable before the expression (expr) is queried.

Thank you all for your help!

The next step is to get the result graphics to use a unique value renderer so the different crime types use a unique picture marker.

Thanks again,

Chris B.
0 Kudos
JulieYuan
New Contributor II
Hi Christopher,

I have almost same request as yours :  select a date range, search the Crime Layers.
I never worked in GIS area. Could you please give me detail information how did you make the eSearch work on the Date range and crime layer search?

  • We have the ArcGIS Viewer for Flex Application Builder Version3.1.

  • Download the Enhanced Search Widget Version 3.1.12. Do you use the Compiled eSearch or unCompiled eSearch?


  • Thanks,

    Julie
    0 Kudos
    JulieYuan
    New Contributor II
    QUOTE=cblinnmrc;207871]All,

    I got the eSearch widget to work with a date range.  It actually was pretty simple.

    I added the date selector controls and a conditional statement which checks to see if the date range is selected, and then concatenates to the eVal variable before the expression (expr) is queried.

    Thank you all for your help!

    The next step is to get the result graphics to use a unique value renderer so the different crime types use a unique picture marker.

    Thanks again,

    Chris B.

    Hi Christopher,
    Finally, I got the eSearch widget to work with combined fields.
    But the date field doesn't work. I am using SQL Server database, the call date type is DATE.
    How do you put the Calender button on the eSearch?

    [ATTACH=CONFIG]25231[/ATTACH]

    Thanks,

    Julie
    0 Kudos
    ChristopherBlinn1
    Occasional Contributor III
    Julie,

    I was using the 2.5 Flex Viewer and everything I added was to the uncompiled version of Robert's widget.

    I have not even looked at the 3.1 version, but that is mainly because I am moving away from Flex and doing Javascript now.

    The changes from 2.5 to 3.1 are quite substantial, and with my time no longer devoted to Flex I have no idea when I will get around to configuring the widget to the 3.x version.

    Chris B.
    0 Kudos