Select to view content in your preferred language

Modifying Tabbedribbon template with URL parameter attribute query

568
2
09-20-2010 12:16 PM
BrianPangtay
Regular Contributor
Starting with the TabbedRibbon template, I want to add a query by attribute where the attribute is passed as an URL parameter.

The template already has a spatial query defined using binding to a collapsible panel to display attributes of selected features. A global QueryTask variable is created and the results of that object is binded to the collapsible panel.

I added an attribute query which uses the same QueryTask variable as the spatial query but the attributes of the feature found by the attribute query are not being shown in the collapsible panel. However, it is creating a graphic of a feature so I know that the query returned a valid result. I've made it work by defining an alternate datagrid but I would rather use the existing collapsible panel for both.

Is there a problem with using the same queryTask variable and/or binding 2 kinds of queries to the same collapsible panel?

Attached is the modified code. Thus, one can specify the State one wants to find by changing the URL by adding the following string to the end (note: don't include the double quotes): "?state=Texas". So far, the application will highlight the chosen state but doesn't add the state's attributes to the pop-up dialog.
0 Kudos
2 Replies
BrianPangtay
Regular Contributor
Can someone explain why binding is done every time the graphics layer is drawn? Can't it just occur a single time at initialization?

Thanks for your help.
0 Kudos
BrianPangtay
Regular Contributor
Attached is the final code using Visual Studio 2010. I had to bind the results upon page load and specify additional properties for the query.
0 Kudos