Select to view content in your preferred language

How to Execute a Query via Button for Existing Feature Layer Features?

577
1
05-24-2012 11:40 AM
JHayes
by
Frequent Contributor
Hello,

I'm trying to execute a query on some existing feature layer features.  Most of the query examples use a text field for input from the user.  I'd like to a few buttons that execute a specific query on the existing feature layer features.  I have a comment application that allows people to leave point and/or line comments using the editor.  I have a link bar that switches from the Editor legend renderer to a search window where I have buttons for each type of comment.  I want the user to be able to click the button for "Pedestrian" and a query for Pedestrian comments executes and displays only those comments on the map.

I've been trying to find ways to bind the query to the feature services "Cat1" field that holds the domains values (Ped, Air, Car) for the comment type, but no luck thus far.

Any help would be great!

Thanks,
Joe
Tags (2)
0 Kudos
1 Reply
ThomasMcCracken
Deactivated User
I believe you need to use a where statement for your query.  So instead of text="some value" in your query tag, use a where = "(the attribute) = (your button value)"

For example, I have a query with a where statement that looks like this: where="FEEDERID LIKE UPPER ('%(fText.text)%')".  This queries my FEEDERID attribute for my entered text input using all capitals and wildcards.
Hope this helps.  Make sure to look at the query section in the API reference also.

Thomas McCracken
GIS Analyst
Georgia Power Company
0 Kudos