query on ShapefileFeatureTable

725
0
02-15-2017 11:59 AM
zhenzeng
New Contributor

hello,

I use arcgis sdk for java(10.2.4).And I wanna to query the ShapefileFeatureTable as folows making it able to return the specified field .But the results seems to return all the field not only the the specified field.

private final String[] ATTR_NAMES =
new String[] {"NAME_0", "NAME_1", "NAME_2"};

QueryParameters query = new QueryParameters();
query.setOutFields(ATTR_NAMES);

shapefileTable_sw.queryFeatures(query,callback);

callback

CallbackListener<FeatureResult> callback=new CallbackListener<FeatureResult>() {

@Override
public void onError(Throwable e) {
// JOptionPane.showMessageDialog(contentPane, wrap("Error: "+e.getLocalizedMessage()), "", JOptionPane.ERROR_MESSAGE);
System.out.println("QUERY ERROR");
}

@Override

public void onCallback(FeatureResult objs) {
for (Object objFeature : objs) {
Feature feature = (Feature) objFeature;
//System.out.println(feature.getAttributes());
createPopView(feature);
}
}
};

Does the shapefile feature table not support the seOutFields function? Or there is somthing wrong with my code?

0 Kudos
0 Replies