<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Qualify field names in action script/xml in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262057#M6179</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;mx:DataGridColumn id="rnc" labelFunction="labelFunction" headerText="Roll_Number" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;labelFunction is a property of DataGridColumn. It should be set to the name of the function, so it could also be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;labelFunction="myLabelFunction" if myLabelFunction was the function name.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Apr 2011 17:50:26 GMT</pubDate>
    <dc:creator>DasaPaddock</dc:creator>
    <dc:date>2011-04-27T17:50:26Z</dc:date>
    <item>
      <title>Qualify field names in action script/xml</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262054#M6176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to build a tool that extracts information from a feature layer attribute table that has a joined table and i'm trying extract certain fields into a DataGrid for the end user to see and use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using ArcGIS Server Workgroup and flash builder to build my flex application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm stuck however on getting the attributes into the data grid.&amp;nbsp; My Parcels Layer is a field base geodatabase called -Parcels-, and i've joined to a SQL table (sql server express) called -LinkedTable-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm adding the attributes to the data grid through code/action script (below) but i can't get the attributes into my data grid.&amp;nbsp; The xml at the bottom is how i'm creating the datagrid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If i were to switch layers and use one that does not have a table join I'm able to get this to work - however when the field is joined to a table i'm unable to figure out how to properly qualify the table field names...?&amp;nbsp; Any ideas&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arrayResults.addItem(graphic.attributes);&amp;nbsp;&amp;nbsp; //this takes the attributes from the graphic, but the datagrid datafield isn't connecting with Parcels.ARN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//arrayResults.addItem(graphic.id.toString());&amp;nbsp; //this forces the text into the data grid - band aid solution and a round about way&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;mx:DataGrid id="resultsGrid"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width="100%" height="170" top="25" fontSize="9" allowMultipleSelection="true"&amp;nbsp;&amp;nbsp; &amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;lt;mx:columns&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:DataGridColumn dataField="Parcels.ARN" headerText="Roll Number"&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:DataGridColumn dataField="LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullName" headerText="Name" wordWrap="true"&amp;nbsp; /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:DataGridColumn dataField="LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.ASYSTcivic" headerText="Asyst Civic A." visible="false" id="cadd" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:DataGridColumn dataField="LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullMailingLabel" headerText="Mailing Address" wordWrap="true"/&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:DataGridColumn dataField="LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.HomePhone" headerText="Home Phone" wordWrap="true" visible="true"/&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/mx:columns&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;/mx:DataGrid&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 15:12:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262054#M6176</guid>
      <dc:creator>ChrisMahon</dc:creator>
      <dc:date>2011-04-11T15:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Qualify field names in action script/xml</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262055#M6177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try using this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/dataGridClasses/DataGridColumn.html#labelFunction" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/dataGridClasses/DataGridColumn.html#labelFunction&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private function labelFunction(item:Object, column:DataGridColumn):String
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; return item["LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullName"];
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:50:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262055#M6177</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2021-12-11T12:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Qualify field names in action script/xml</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262056#M6178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do I get this function to fire...? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried this&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;mx:DataGridColumn id="rnc" dataField="labelFunction('LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullName',rnc);" headerText="Roll_Number"&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No luck?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Try using this:&lt;BR /&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/dataGridClasses/DataGridColumn.html#labelFunction" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/dataGridClasses/DataGridColumn.html#labelFunction&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private function labelFunction(item:Object, column:DataGridColumn):String
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; return item["LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullName"];
}
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:50:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262056#M6178</guid>
      <dc:creator>ChrisMahon</dc:creator>
      <dc:date>2021-12-11T12:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Qualify field names in action script/xml</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262057#M6179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;mx:DataGridColumn id="rnc" labelFunction="labelFunction" headerText="Roll_Number" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;labelFunction is a property of DataGridColumn. It should be set to the name of the function, so it could also be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;labelFunction="myLabelFunction" if myLabelFunction was the function name.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 17:50:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262057#M6179</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2011-04-27T17:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Qualify field names in action script/xml</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262058#M6180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks - it works now perfectly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Try:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;mx:DataGridColumn id="rnc" labelFunction="labelFunction" headerText="Roll_Number" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;labelFunction is a property of DataGridColumn. It should be set to the name of the function, so it could also be:&lt;BR /&gt;labelFunction="myLabelFunction" if myLabelFunction was the function name.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 18:16:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262058#M6180</guid>
      <dc:creator>ChrisMahon</dc:creator>
      <dc:date>2011-04-27T18:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Qualify field names in action script/xml</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262059#M6181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Dasa, This is great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was needing this for my selection widget.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris, A few things to consider.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorting of the fields is not available when using a labelFunction without the datafield. To fix this you can add a custom sortComapre function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have lots of fields you would have to create labelFunctions and sortCompare functions for each field, so creating a more reusable solution would be a better approach.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my reusable approach. Feel free to use it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private function labelOf(fullfieldname:String):Function
{
 return&amp;nbsp; function (item:Object, column:DataGridColumn):String 
&amp;nbsp;&amp;nbsp; { 
&amp;nbsp;&amp;nbsp;&amp;nbsp; return item[fullfieldname];
&amp;nbsp;&amp;nbsp; };
}

private function sortOf(fullfieldname:String):Function 
{&amp;nbsp; 
 return function (obj1:Object, obj2:Object):int 
&amp;nbsp;&amp;nbsp; {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(obj1[fullfieldname] &amp;lt; obj2[fullfieldname]) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return -1;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; else if(obj1[fullfieldname] &amp;gt; obj2[fullfieldname])
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; else 
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; } 
&amp;nbsp;&amp;nbsp; };
}

&amp;lt;mx:DataGridColumn headerText="Roll Number" 
 labelFunction="{labelOf('Parcels.ARN')}" sortCompareFunction="{sortOf('Parcels.ARN')}"/&amp;gt;
&amp;lt;mx:DataGridColumn headerText="Name" wordWrap="true"
 labelFunction="{labelOf('LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullName')"}
 sortCompareFunction="{sortOf('LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullName')}"/&amp;gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:51:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262059#M6181</guid>
      <dc:creator>MarkHoyland</dc:creator>
      <dc:date>2021-12-11T12:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Qualify field names in action script/xml</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262060#M6182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mark,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You may be able to only have one label function if you make use of the column that's passed in. In the mxml you could set the dataField on the column and refer to that in the label function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 16:21:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262060#M6182</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2011-04-29T16:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Qualify field names in action script/xml</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262061#M6183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks every one.&amp;nbsp; I've used the suggestions to the last two posts and things are cleaned up nicely.&amp;nbsp; My Problem is solved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have a great day!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Mark,&lt;BR /&gt;&lt;BR /&gt;You may be able to only have one label function if you make use of the column that's passed in. In the mxml you could set the dataField on the column and refer to that in the label function.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 May 2011 12:04:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/qualify-field-names-in-action-script-xml/m-p/262061#M6183</guid>
      <dc:creator>ChrisMahon</dc:creator>
      <dc:date>2011-05-03T12:04:18Z</dc:date>
    </item>
  </channel>
</rss>

