Select to view content in your preferred language

Identify Widget Not Returning Records

5388
8
Jump to solution
01-28-2013 07:43 AM
daveostrander
Frequent Contributor
Robert I am having a little trouble using the Identify Widget for Flex 3.0 using the app builder version. The tool seems to be doing everything right except returning the record from my rest endpoint. I am using the following code in the widget settings to access my layers from my arcgis server rest directory. I believe I have entered everything exactly how it should be, but obviously I have missed something along the way. Could you take a look at my code and let me know if I have entered something in error?

<layers onlythese="true">
        <layer>
            <name>Parcels</name>
            <fields>
                <field name="Grundy_Master.SDEDATA.Parcel_Poly.PIN" type="esriFieldTypeString" alias="PIN"/>
                <field name="VPAMSTAXCODE" alias="Tax Code" popuponly="true"/>
            </fields>
            <links>
                <link includeinresults="false" field="" alias="" tooltip="">
                    <linkprefix/>
                    <linksuffix/>
                    <iconfield/>
                    <iconprefix/>
                    <iconsuffix/>
                </link>
            </links>
            <zoomscale>9028</zoomscale>
            <forcescale>true</forcescale>
        </layer>
    </layers>

Thanks,

Dave-O
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Dave,

   So I built a test case to try and mimic your senario by having a group with the name of Parcels and a sub layer with the name Parcels and a definition query and joined to a table so that I had it resembles your situation. Well long story short it worked fine. I have attached a pdf of my REST Service directory and highlighted the important areas. Notice that the name of a field is Parcels3.TMP_NO and the alias is Temp Number and Temp Number is what you need to use in the xml for the field name (as instructed in the documentation). And here is the way I configured it in the IdentifyWidget.xml:

    <layers onlythese="true">         <layer>             <name>Parcels</name>             <fields>                 <field name="NAME" />                 <field name="Temp Number" />                 <field name="Street Address" />             </fields>             <links>                 <link includeinresults="false" field="" alias="" tooltip="">                     <linkprefix></linkprefix>                     <linksuffix></linksuffix>                     <iconfield></iconfield>                     <iconprefix></iconprefix>                     <iconsuffix></iconsuffix>                 </link>             </links>             <zoomscale>12000</zoomscale>             <forcescale>true</forcescale>         </layer>


Hopefully this will help you understand where you are going wrong.

View solution in original post

0 Kudos
8 Replies
daveostrander
Frequent Contributor
I also tried:

<layers onlythese="false"></layers> and removed the layer code.

Using that code solved the problem and returned the records. However, I would like a little more control on what gets displayed in results window and what gets displayed in the pop up window. I would also like to limit what layers will get identified.

Since that code did the trick that must mean that I am missing something from the exact name listed in my rest directory. That said I am not sure how to name it differently. I am using groups for my layers which may be playing a role in this. Should I be referencing the layer id instead? Or should I be using localhost/arcgis/rest/services/foldername/layername/mapserver/layerid?

I have a few outs one being using the onlythese= 'false', but I would like to get it working as intended.

Any help would be greatly appreciated.
0 Kudos
AnthonyGiles
Honored Contributor
Dave,

You need to reference your fields by their Field Aliases in the REST endpoint

Regards

Anthony
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dave,

   What trips most people up is using the layer name from the Rest Services directory and Using the Field alias names from the REST Service directory in the xml name attribute.
0 Kudos
daveostrander
Frequent Contributor
Yes, I have no doubt that is it however I am not getting anywhere with altering those parts of the code. The layer participates in a join so I have since fixed (I think) the join fields to show db.sde.tablename.fieldname fieldname being the field name of the joined field. I am still unsure about handling grouped layers. Would looking at my code in conjunction with a screen  shot of my rest directory help you interpret where I have gone wrong. I essentially have the same layer "Parcels" repeated at various scale extents and grouped with another layer named "Condos". I have just been testing Parcels and two fields to see if I can at least get data back without adding a bunch of layers and hence more variables. Maybe the parent layer name should be the group name, but i am a little unsure on how to handle sub layers.


[ATTACH=CONFIG]21140[/ATTACH]


[ATTACH=CONFIG]21141[/ATTACH]


[ATTACH=CONFIG]21142[/ATTACH]

Thanks for getting back to me so quickly and creating such a nice widget!

Dave-O.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dave,

   I don't think I have ever run into a situation where someone has the parent layer and the sub layer named the same exact name. This could be problematic, but I will have to test this senario.
0 Kudos
daveostrander
Frequent Contributor
Robert,

Yes that was one of my worries as well. I am actually a bit surprised that setting the onlytheselayers = "false" works given the current construct. For now I will just use it as is, and not worry about aesthetic tweaks.

I wonder if I will run into trouble using your relate widget/"Info Template" later on. I am hoping to use that since not only do I have joins, but also a few relates with this data. I really hope I haven't complicated things too much, as it was my initial intention to keep things ordered and simple to understand. In reality the scale classifications are really imperative to the look and feel of the application.


Thanks for getting back once again and please let me know if you need anything from me to aid in your testing.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dave,

   So I built a test case to try and mimic your senario by having a group with the name of Parcels and a sub layer with the name Parcels and a definition query and joined to a table so that I had it resembles your situation. Well long story short it worked fine. I have attached a pdf of my REST Service directory and highlighted the important areas. Notice that the name of a field is Parcels3.TMP_NO and the alias is Temp Number and Temp Number is what you need to use in the xml for the field name (as instructed in the documentation). And here is the way I configured it in the IdentifyWidget.xml:

    <layers onlythese="true">         <layer>             <name>Parcels</name>             <fields>                 <field name="NAME" />                 <field name="Temp Number" />                 <field name="Street Address" />             </fields>             <links>                 <link includeinresults="false" field="" alias="" tooltip="">                     <linkprefix></linkprefix>                     <linksuffix></linksuffix>                     <iconfield></iconfield>                     <iconprefix></iconprefix>                     <iconsuffix></iconsuffix>                 </link>             </links>             <zoomscale>12000</zoomscale>             <forcescale>true</forcescale>         </layer>


Hopefully this will help you understand where you are going wrong.
0 Kudos
daveostrander
Frequent Contributor
Robert,

That did the trick. I really appreciate your time, effort, and commitment to your code.

Many Thanks,

Dave-O.
0 Kudos