Select to view content in your preferred language

Auto Complete Attribute Query

1020
1
11-11-2013 09:09 PM
cadgism
Regular Contributor
Hi

I am working on a landmark(point)  feature layer. I query this layer with a WhereClause so that it brings a single value (name)  from the attributes of each feature. I put this featureset into a  graphics array.

On postexecute,  I get the attribute value from the graphics array  and put it in an adapter. This data adapter is set to an  autocomplete text view. When the user key in any 2  letters,  the attribute values that 'contain' these letters display as drop down so that the user can select and query again for the location to see it in the map.

Everything is working fine except that not all the data that "contains" these letters are displayed but only few. It seems there is a limit  set some where. how can i over come this? Any Idea? Please?

Here is the Code.


private class RunQueryForArray extends AsyncTask<String, Void, Graphic[]>{
 @Override
 protected void onPreExecute() {
     progress = ProgressDialog.show(SearchLandmarkActivity.this, "Landmark Search","Please wait....");
  }
 @Override
 protected Graphic[] doInBackground(String... params) {
  // TODO Auto-generated method stub
  String WhereClause = "NAME <> '0'" ;
  Query query = new Query();
  query.setWhere(WhereClause);
  query.setReturnGeometry(true);
  query.setOutFields(new String[] {"NAME"});
  
  QueryTask qTask = new QueryTask(featureServiceURL);
  FeatureSet fs = null;
 try{ 
  fs = qTask.execute(query);
  Graphic[] grs = fs.getGraphics();
   return grs;
  }
      catch(Exception e) {
   e.printStackTrace(); 
  }
  return null;
 }
 @Override
 protected void onPostExecute(Graphic[] graphics) {
  List<String> mArray = new ArrayList<String>();
 for (Graphic gr : graphics) {
   String mName = (String)gr.getAttributeValue("NAME");
   mArray.add(mName);
         }
       progress.dismiss();
       ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_dropdown_item_1line, mArray);
    AcTv.setThreshold(2);
      AcTv.setAdapter(adapter);
   }
      }  



0 Kudos
1 Reply
ThomasBinu
Deactivated User
Are you sure, there is not limit set to the arcgis server?
0 Kudos