Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two ways to display an InfoWindow with the attributes of a graphic. The first is using a IdentifyTask to return the graphic and the other gets the selectedItem of a Datagrid (rovGrid) and using the findGraphicByAttribute code to return the graphic.

However, the format of the Date field is different in the returned graphic. The IdentifyTask graphic attribute shows "2/10/2005" and the Datagrid graphic attribute shows "1107993600000". Why are the two methods showing different date formats for the same feature?

Here's the partial code for each method


identifyTask.execute(identifyParams, new AsyncResponder(onResult, onFault, clickGraphic));

function onResult(results:Array, clickGraphic:Graphic = null):void
    if (results && results.length > 0)
        var result:IdentifyResult = results[0];
        var resultGraphic:Graphic = result.feature;

//Datagrid click

private function rovGrid_Click():void { var obj:Object = rovGrid.selectedItem;

if (obj != null)

    var graphic:Graphic = findGraphicByAttribute(obj, layerROVGraphics);

attributes for each return

share|improve this question
Can you reduce this to a REST API issue? In other words, is the date value returned by the server for an Identify request different from that returned by a Query? Use Fiddler to see what the urls are, then change the json to pjson in the request to see what the response is. – Kirk Kuykendall Jun 24 '11 at 21:38
up vote 1 down vote accepted

I think Kirk nailed it. The DataGrid turns the values into an ArrayCollection as the DataGrid.dataProvider. When it does this, Flex does some internal stuff to bind these values to the DataGrid (notice the mx_internal_uid property). It looks like when it does this, it no longer knows the value shown should represent a date, it leaves this format responsibility up to the developer.

share|improve this answer
I put in some additional code to convert the string to a Date, then ran that through the DateFormatter. I also had to put some additional code in to catch nulls, since I would get back either "Null" or "null" when clicking on a point with no value in the date field. The DateFormatter will take "Null" but not "null". – kenbuja Jun 28 '11 at 19:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.