Select to view content in your preferred language

Search results (attributes & shapes) not visible in Enhanced Search Widget - WAB

4275
5
Jump to solution
05-08-2015 08:59 AM
AdamGebhart
Frequent Contributor

Can Robert Scheitlin or anybody else provide some assistance for my problem?

I have configured the eSearch widget to search for things such as voting precincts or zoning districts from a dropdown list. I have accomplished this using the following settings:

When I run the search I get results, but the attributes are not visible in the results tab.  I have configured specific attributes from that dataset to appear in said tab.  However, you can see below they do not appear.

I have set up other searches in this same widget, such as those for parcel number or site address, that work properly in terms of returning the results in the results tab.  These searches do not include the use of unique values or dropdowns though as the user must enter the information.  

Does anybody see something that is preventing the results from appearing in the results tab?  Here are more screenshots of my configuration.  FYI, all of these settings match the settings for the other searches that do return attributes in the results tab.  Note: The search URL will be repopulated in my configuration.

Attached is config_EnhancedSearch.json from my app.  Look for the "Precincts" and "Zoning" searches.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Adam,

   The issue has nothing to do with the layer being visible in the map or not (as the eSearch will work with a layer that is not even added to the map). It is the fact that the mapservice you are searching does not have the shape field visible:

Fields:

    OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID )

    NAME ( type: esriFieldTypeString , alias: NAME , length: 50 )

    SENATE_DISTRICT ( type: esriFieldTypeSmallInteger , alias: SENATE_DISTRICT )

    POLLING_SITE ( type: esriFieldTypeString , alias: POLLING_SITE , length: 65 )

    IC_COUNCIL_DISTRICT ( type: esriFieldTypeString , alias: IC_COUNCIL_DISTRICT , length: 5 )

    KIRKWOOD_DIR_DISTRICT ( type: esriFieldTypeString , alias: KIRKWOOD_DIR_DISTRICT , length: 6 )

    Shape_Length ( type: esriFieldTypeDouble , alias: Shape_Length )

    Shape_Area ( type: esriFieldTypeDouble , alias: Shape_Area )

    HOUSE_DISTRICT ( type: esriFieldTypeSmallInteger , alias: HOUSE_DISTRICT )

    COMBINED_REG_PRECINCT_NAME ( type: esriFieldTypeString , alias: COMBINED_REG_PRECINCT_NAME , length: 50 )

    SCHOOL_POLLING_SITE ( type: esriFieldTypeString , alias: SCHOOL_POLLING_SITE , length: 65 )

    PRECINCT_SPLIT ( type: esriFieldTypeString , alias: PRECINCT_SPLIT , length: 8 )

    SCHOOL_PRECINCT ( type: esriFieldTypeString , alias: SCHOOL_PRECINCT , length: 15 )

    COMB_REG_PREC_ABBREV ( type: esriFieldTypeString , alias: COMB_REG_PREC_ABBREV , length: 12 )

    SCH_CTRL_CO ( type: esriFieldTypeString , alias: SCH_CTRL_CO , length: 1 )

Without having the shape field visible you can not return geometry in a search thus causing the eSearch widget to choke on the results. All your other layer that are working HAVE the shape field visible in the map service.

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Emeritus

Adam,

Your General Voting Precincts layer has the shape field hidden in the MXD and thus is causing an issue in eSearch. Go into the MXD and un-hide the Shape field and republish the service.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Adam,

  This thread was locked previously until it was approved by a moderator. It should be good to go now though.

0 Kudos
AdamGebhart
Frequent Contributor

Thanks.  I was wondering if that would be an issue.  I forgot to add in my first post that the voting precincts layer is one that I do NOT want visible at startup and want the user to toggle it on and off as they wish.  The same thing applies to the zoning layer.

I just republished the service with the voting precincts visible by default, but left the service not visible in my AGOL map used for WAB.  Again, I was able to run the search but didn't have anything in the results tab.  Then, I updated the AGOL map to have the service (w/precinct layer turned on) visible on WAB startup.  Again, the search runs but doesn't populate the results tab.

Should I be able to have those layers or services invisible at startup, make them visible as needed, then run the search and see the attributes in the results tab?  We use the eSearch widget in our Flex viewer for similar searches and it runs smoothly.  Am I doing something else wrong?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Adam,

   The issue has nothing to do with the layer being visible in the map or not (as the eSearch will work with a layer that is not even added to the map). It is the fact that the mapservice you are searching does not have the shape field visible:

Fields:

    OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID )

    NAME ( type: esriFieldTypeString , alias: NAME , length: 50 )

    SENATE_DISTRICT ( type: esriFieldTypeSmallInteger , alias: SENATE_DISTRICT )

    POLLING_SITE ( type: esriFieldTypeString , alias: POLLING_SITE , length: 65 )

    IC_COUNCIL_DISTRICT ( type: esriFieldTypeString , alias: IC_COUNCIL_DISTRICT , length: 5 )

    KIRKWOOD_DIR_DISTRICT ( type: esriFieldTypeString , alias: KIRKWOOD_DIR_DISTRICT , length: 6 )

    Shape_Length ( type: esriFieldTypeDouble , alias: Shape_Length )

    Shape_Area ( type: esriFieldTypeDouble , alias: Shape_Area )

    HOUSE_DISTRICT ( type: esriFieldTypeSmallInteger , alias: HOUSE_DISTRICT )

    COMBINED_REG_PRECINCT_NAME ( type: esriFieldTypeString , alias: COMBINED_REG_PRECINCT_NAME , length: 50 )

    SCHOOL_POLLING_SITE ( type: esriFieldTypeString , alias: SCHOOL_POLLING_SITE , length: 65 )

    PRECINCT_SPLIT ( type: esriFieldTypeString , alias: PRECINCT_SPLIT , length: 8 )

    SCHOOL_PRECINCT ( type: esriFieldTypeString , alias: SCHOOL_PRECINCT , length: 15 )

    COMB_REG_PREC_ABBREV ( type: esriFieldTypeString , alias: COMB_REG_PREC_ABBREV , length: 12 )

    SCH_CTRL_CO ( type: esriFieldTypeString , alias: SCH_CTRL_CO , length: 1 )

Without having the shape field visible you can not return geometry in a search thus causing the eSearch widget to choke on the results. All your other layer that are working HAVE the shape field visible in the map service.

AdamGebhart
Frequent Contributor

Sorry about the mix up.  I thought you were referring to layer visibility in the mxd or AGOL.

I had turned off some fields in specific layers in each of my map services as there are fields that aren't necessary to carry over to the end user.  Looks like I got a little carried away.  I went back and turned on the 'Shape' field my precincts and zoning layers and it's working now!

Again, thanks for putting the widget out for all of us and for your quick and helpful responses. 

0 Kudos