Feature Layer and Definition Expression

2545
4
03-08-2011 10:38 AM
PaulLang
New Contributor III
Within a Flex APP. Building a definition Expression from user into and tying it together is no big deal. I would like to do this in the Flex Viewer. How do I send the user input from my widger to a featurelayer within the Config.xml?
Tags (2)
0 Kudos
4 Replies
JonFisher
New Contributor III
Looks like you posted this in two threads by mistake. My reply:

You can either:
Use the QueryWidget (http://help.arcgis.com/en/webapps/flexviewer/help/widgets/query_widget.htm) and use the preload="open" tag to show a subset of a map service when the map loads, rather than just adding it as an operational layer.

Or, if using a feature layer, use the definitionexpression attribute as specified here:
http://help.arcgis.com/en/webapps/flexviewer/help/layer_tag.htm
0 Kudos
PaulLang
New Contributor III
Thanks for the reply.
I can preset using this in the config:
           <layer label="NeighborhoodbyBldgQualityCode" type="feature" visible="false" alpha="1" definitionexpression="NBHDNUM='5b097'"
         url="http://gcgis/ArcGIS/rest/services/Monthly/NeighborhoodbyBldgQualityCode/MapServer/0" />

How can I send the NBHDNUM='5b097' from my user input into the config.xml?

private function doSearchBldgQualityCode():void
   {      NeighborhoodbyBldgQualityCode.definitionExpression = "NBHDNUM  ='" + qTextBldgQualityCode.text + "'";
   }
0 Kudos
ShannakaBeveridge
New Contributor II
Hi,

I created this widget when trying to work out the same thing, hopefully it will help you out with what you want to do.

Cheers,

Shannaka
0 Kudos
PaulLang
New Contributor III
Thank you so much, this helps me understand the communication process and gets the definition expression working.
0 Kudos