Select to view content in your preferred language

Weird query done by DetailsTask

758
4
09-01-2010 08:24 AM
Ganael_Jatteau
Emerging Contributor
Hello,

I use a DetailsTask to explore a rest layer on a arcgis 10 workgroup. Sometimes, the http request done by this task looks like:

http://localhost:8080/query?outFields=&f=json&returnGeometry=false&where=null%20is%20not%20null&spatialRel=esriSpatialRelIntersects"]. URL: http://localhost:8080/query?outFields=&f=json&returnGeometry=false&where=null%20is%20not%20null&spatialRel=esriSpatialRelIntersects


And of course it returns an error.

The code is quite simple:

var detailsTask:DetailsTask = new DetailsTask();
detailsTask.url = "http://ags10wg:8399/arcgis/rest/services/test1/MapServer";
detailsTask.getDetails(7, new AsyncResponder(detailResult, onFault));


Anybody else got this problem?
Tags (2)
0 Kudos
4 Replies
Ganael_Jatteau
Emerging Contributor
It seems that this problem happens when the layer names have some aliases. I've downloaded the latest flex lib 2.0 from the resource center and the problem still happens.

the method:
detailsTask.getDetails(layerId, new AsyncResponder(detailResult, onFault));

first queries the JSON of the layer. Then there must be a bug interpreting the json because the next query done to the server is the one described in the previous post.
0 Kudos
Ganael_Jatteau
Emerging Contributor
I confirm. DetailsTask doesn't work when the layer names are different from the datasources in a service.
0 Kudos
DasaPaddock
Esri Regular Contributor
Can you share the code in your detailResult function?
0 Kudos
DasaPaddock
Esri Regular Contributor
I'm not able to reproduce this issue using the code below. Can you modify the code below to show how this issue can be reproduced?

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:esri="http://www.esri.com/2008/ags">

    <s:layout>
        <s:VerticalLayout horizontalAlign="center" paddingTop="10"/>
    </s:layout>

    <fx:Script>
        <![CDATA[
            import mx.rpc.AsyncResponder;
            
            protected function button1_clickHandler(event:MouseEvent):void
            {
                detailsTask.getDetails(0, new AsyncResponder(myResultFunction, myFaultFunction));
                
                function myResultFunction(result:Object, token:Object = null):void
                {
                    trace(result);
                }
                function myFaultFunction(error:Object, token:Object = null):void
                {
                    trace(error);
                }
            }
        ]]>
    </fx:Script>

    <fx:Declarations>
        <esri:DetailsTask id="detailsTask" url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/MapServer"/>
    </fx:Declarations>
    
    <s:Button click="button1_clickHandler(event)" label="Get Details"/>

</s:Application>
0 Kudos