Search: "Pagination is not supported."

8417
11
Jump to solution
03-26-2015 03:13 PM
BenFousek
Occasional Contributor III

Trying to get the new Search running against a feature layer. enableSuggestions and enableSuggestionsMenu are false. Don't see anything else in docs which warns of 10.3/supportsPagination = true.

Any help appreciated.

sources: [{
  featureLayer: new FeatureLayer('.../Parcels/FeatureServer/0', {
  outFields: ['*']
  }),
  searchFields: ['ADDRESS', 'PARCEL_ID', 'OWNER'],
  displayField: 'ADDRESS',
  exactMatch: false,
  outFields: ['*'],
  name: 'Parcels',
  placeholder: 'Search parcels',
  enableSuggestions: false,
  enableSuggestionsMenu: false,
  minCharacters: 3
}]
Tags (1)
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

There is currently a bug with the search widget that requires services to support pagination. This bug will be fixed for the next release.  You can workaround it in your application by  setting maxResults to a string if the layer doesn't support pagination. Here's some code that shows how that might work.

                //workaround to handle bug with pagination remove at 3.14
                array.forEach(defaultSources, lang.hitch(this, function (s) {
                    var paging = this._supportsPagination(s);
                    if (!paging) {
                        s.maxResults = "foo";
                    }
                }));



        _supportsPagination: function (source) {
            // check if featurelayer supports pagination remove at 3.14
            var supported;
            if (source.locator) {
                supported = true;
            } else if (source.featureLayer) {
                // supports pagination
                if (source.featureLayer.advancedQueryCapabilities && source.featureLayer.advancedQueryCapabilities.supportsPagination) {
                    supported = true;
                }
            }
            return supported;
      }

View solution in original post

11 Replies
RichardMoussopo
Occasional Contributor III

I also noticed that the Search multiple sources widget only works for the featureServer type. I tried to search through featureLayer of type ...MapServer/0 and got the pagination error as below...

Searchmultiplesources.PNG

0 Kudos
KellyHutchins
Esri Frequent Contributor

There is currently a bug with the search widget that requires services to support pagination. This bug will be fixed for the next release.  You can workaround it in your application by  setting maxResults to a string if the layer doesn't support pagination. Here's some code that shows how that might work.

                //workaround to handle bug with pagination remove at 3.14
                array.forEach(defaultSources, lang.hitch(this, function (s) {
                    var paging = this._supportsPagination(s);
                    if (!paging) {
                        s.maxResults = "foo";
                    }
                }));



        _supportsPagination: function (source) {
            // check if featurelayer supports pagination remove at 3.14
            var supported;
            if (source.locator) {
                supported = true;
            } else if (source.featureLayer) {
                // supports pagination
                if (source.featureLayer.advancedQueryCapabilities && source.featureLayer.advancedQueryCapabilities.supportsPagination) {
                    supported = true;
                }
            }
            return supported;
      }
BenFousek
Occasional Contributor III

Thanks Kelly Hutchins

Time frame on next release?

0 Kudos
KellyHutchins
Esri Frequent Contributor

Sorry Ben I don't have specifics on a time frame. Julyish?

0 Kudos
BenFousek
Occasional Contributor III

Thanks...trying to determine whether to wait or hack. 🙂

0 Kudos
TomWayson
Esri Contributor

Thanks Kelly, that workaround stopped the error for me.

However, it should be noted that it appears that suggestions will not be enabled for sources that do not support pagination.

0 Kudos
KellyHutchins
Esri Frequent Contributor

Tom Wayson​ correct suggest is only available if you are working with a 10.3 geocoding service that has suggest capability or a 10.3 feature layer that supports pagination.

BenFousek
Occasional Contributor III

Kelly Hutchins​ AGS 10.3 up and running. 10.3 DBS on it's way. Can't wait! Thanks for all your work!

0 Kudos
AnninaHirschi_Wyss1
Occasional Contributor III

Kelly Hutchins‌, is there a way to enable suggestions also for Layers not supporting pagination? Thanks

0 Kudos