How to number the rows in the Results List and Results Table?
In one of our current (Non-Geocortex) applications we have functionality that will take query results and number the rows in the attribute table from 1-n, and then place a label on the map feature that corresponds to the row number. I would like to be able to do this in my GCX app. It's nice to see at a glance which features go with each row, especially as clicking on the map feature in GCX does not light up the row in the table.
I thought I might be able to add a field to output featureset from the QueryTask, use it to number the rows, and then place graphic text labels on the features with the info from the new field.
The problem is that I can add a field to the featureset and see it if I iterate through the attributes inside the workflow, but the new field does not show up in the Results List or the Results table.
So, I either need a method of numbering the rows in the Results Table (and grab the values to use for graphic labels) or I need the newly added field of the featureset to show up as a field in the Results Table.
Any thoughts? It's nice to be able to visually relate the map back to the results table.
0
-
I was able to do this.... only to a certain point. I can add a new column to the featureset and have it show up in the data table results, IF I use SelectFeatures and leave the MapServiceID blank. This way it picks up the changes to the featureset rather than going back to the map service to determine the fields to display.
1. Problem 1 - the new column comes in at the END of the table, not as the first field. So, not visible without scrolling when table opens.
2. Problem 2 - I can use InvokeMethod with the INSERT option rather than the ADD option and then I can specify the index of the new field. Unfortunately when the featureset is processed, there are two parts to the string, the first which is the FIELD/SCHEMA info. The field is in the right place at index = 0. The second part of the JSON string is the dictionary of features and attributes, and these are ordered with the new field at the end of the line. Have not figured out a way to reorder the attributes.
3. Problem 3, and the showstopper - because I did not specify the MapServiceID in SelectFeatures, the values that come across in the featureset no longer have the domain descriptions (for fields with domains) but instead show the coded values. To fix this I would literally have to iterate through every feature and every field in my results and go retrieve the description and replace the coded value in my featureset. This is WAY too much processing, and I will have to figure out a different way to do what I need to do.0 -
Hi Tami,
It sounds like you got really far with your own solution, that's great!
I can add two pieces of information that might help:
1. If you're adding new fields to a FeatureSet, you must also add to the Fields attribute of the FeatureSet object itself so that it's serialized and presented properly in the viewer.
2. Since Essentials does not know about this new field, it will not tell the viewer, so that's why it vanishes when you specify the service ID. One possible workaround would be to specify the feature details formatting when you use the Select Features activity. I'm not sure if that will handle your coded values as we expect though - that's a similar problem where the viewer does not know that it should be replacing values with codes.
You could also add a field to your source data, that you then reassign at runtime when querying and selecting with your workflow (an integer field that's null by default). Then, Essentials will know about the field and you can use the out-of-the-box formatting.
Regards,
-Malcolm0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
2 kommentarer