Flex 3.2 Attribute Table field order - I thought this was configurable in the XML

2226
4
Jump to solution
03-28-2013 08:55 PM
ScottMcGee
Occasional Contributor
Ok, I can't figure out if I'm crazy, dumb, or just missing the point (maybe all three).

According to this ( http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/What_s_new_in_the_3_2_ArcGIS_Vi... )...

What's new in ArcGIS Viewer 3.2 for Flex Widget enhancements and Changes
Attribute Table widget changes

  • Better support for many layers - GitHub/74

  • Edit Widget and Attribute Table Widget - Honor the the order of fields specified in widget configuration - GitHub/23

  • Proxy page, if specified, is now used for related records queries made by Attribute Table widget - GitHub/58




...it sounds like I should be able to specify the fields in the order that I want them to appear in the Flex 3.2 Attribute Table widget. I thought this meant that the order of the fields, as listed in my AttributeTableWidget.xml file, would be reflected in the attribute table. But this doesn't appear to be so.

I have tried all three options for <columnsorder> (the options are alphabetical, fields, and fieldinspector). So far, I've had the fields in the attribute table show in alphabetical order and fields order (which reflects the field order in the source GDB). But I can't get the fields in the attribute table to show in the order that I have specified in the XML file.

What gives? I thought this was an issue that was addressed and fixed with Flex 3.2.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ScottMcGee
Occasional Contributor
I'm just following up on this issue that I previously posted. This problem has now been fixed in Flex 3.3.

I upgraded my application to 3.3, and now all the fields in my attribute table widget are correctly displayed in the same order that I have specified in the AttributeTableWidget.xml file.

Thanks ESRI Flex team!

View solution in original post

0 Kudos
4 Replies
ScottMcGee
Occasional Contributor
After yet more random trial-and-error testing, I have determined that the field order in the attribute table is always based on an alphabetical sort on the field alias. Thus, if my XML looks like this:

<?xml version="1.0" ?>
<configuration>
<layersettings>
     <layer name="Surface USFWS"> <!-- type="feature" -->
        <columnsorder>fields</columnsorder>
<fields>
<field name="LRS_Tract" alias="LRS Tract"/>
<field name="Refuge" alias="Refuge"/>
<field name="Notes" alias="Notes"/>
<field name="NWR_Unit" alias="Unit"/>
</fields>
</layer>
</layersettings>
</configuration>


Then the attribute table looks like this:
[ATTACH=CONFIG]23110[/ATTACH]



However, if I add letters in front of the field alias names, then I can force the fields to sort in the order which I want to see in the attribute table. But this is still regardless of the order that the fields are listed in the XML. While this method achieves the desired results, it is still unacceptable because now the field names have a, b, c, d, etc. appended to the front of them, which is silly and doesn't make sense from an end-user standpoint. So this code:

<?xml version="1.0" ?>
<configuration>
<layersettings>
<layer name="Surface USFWS"> <!-- type="feature" -->
        <columnsorder>fields</columnsorder>
<fields>
<field name="LRS_Tract" alias="c - LRS Tract"/>
<field name="Refuge" alias="a - Refuge"/>
<field name="Notes" alias="d - Notes"/>
<field name="NWR_Unit" alias="b - Unit"/>
</fields>
</layer>
</layersettings>
</configuration>


Results in an attribute table that looks like this:
[ATTACH=CONFIG]23111[/ATTACH]


So, regardless of what ESRI states in the "What's New for 3.2", the attribute table widget does not honor the field order as specfied in the AttributeTableWidget.xml file.


P.S. I have officially submitted this as a bug.
0 Kudos
SarthakDatt
Occasional Contributor III
Hey Scott,

Thanks for reporting this. I can confirm that this is an issue with the AttributeTable component(in the api). Both the Edit and the AttributeTable widget are doing the right thing and while the AttributeInspector(used by the Edit Widget) works fine, the AttributeTable component does not refresh based on the order.

The fix needs to go in the api for this one.
0 Kudos
ScottMcGee
Occasional Contributor
Thanks for the confirmation. It's good to know that I wasn't just missing something simple. I look forward to the updated attribute table widget.
0 Kudos
ScottMcGee
Occasional Contributor
I'm just following up on this issue that I previously posted. This problem has now been fixed in Flex 3.3.

I upgraded my application to 3.3, and now all the fields in my attribute table widget are correctly displayed in the same order that I have specified in the AttributeTableWidget.xml file.

Thanks ESRI Flex team!
0 Kudos