Select to view content in your preferred language

Trouble configuring IdentifyWidget.xml

3993
8
05-27-2012 12:32 PM
by Anonymous User
Not applicable
Original User: scpankow

I am a noob to Flex programming but I am trying to learn. I need to add an Identify widget to my map and I am using the attached IdentifyWidget.xml template. I am not sure how to insert MY information so I have attached my config.xml file. Can you help me to get this working?

Thank you

Shannon Pankow
City of Beaumont, Texas
0 Kudos
8 Replies
ShannonPankow
Emerging Contributor
No one is willing to help me out? Come on, guys! I know there is some one out there that can help me get this working...
0 Kudos
by Anonymous User
Not applicable
Original User: ad_giles@hotmail.com

Shannon,

Theres a couple of things you need to do to get your widget up and running:

1. In your main config file you need to specify that you want the widget to load by adding a new widget tag (this assumes that you have placed the widget in the widgets folder):

<widget label="Identify" icon="assets/images/i_identify.png" config="widgets/Identify/IdentifyWidget.xml" url="widgets/Identify/IdentifyWidget.swf"/>


2.  You then need to configure the config file for the widget, if you want to be able to identify all your layers then just change the layer tag to false:

<layers onlythese="false">


if you want to be more selective about the layer thats you want to be able to identify then set the value to true, but then you will need to configure the widget for each layer you want to id (note the layer name has to be exactly what the layer is called in your REST endpoint):

<layer>
 <name>Case Points</name>
  <fields>
   <field name="PINNO" alias="PINNO" />
   <field name="Number" alias="Number" />
  </fields>
              <links>
          <link includeinresults="true" field="" alias="" tooltip="">
   <linkprefix></linkprefix>
   <linksuffix></linksuffix>
   <iconfield></iconfield>
   <iconprefix></iconprefix>
   <iconsuffix></iconsuffix>
           </link>
  </links>
  <zoomscale>15000</zoomscale>
  <forcescale>true</forcescale>
 </layer>


A good place start learning how to configure the viewer is:

http://help.arcgis.com/en/webapps/flexviewer/help/index.html

Hope this gets you underway

Regards

Anthony
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Shannon,

   As Anthony mentioned your config.xml you post does not even have the widget added to it so you have to begin there. Then in your IdentifyWidget.xml as he also mentioned and my documentation clearly states you need to use the layer name exactly as it is reported in the REST service end point Also your fields in the IdentifyWidget.xml need to be the field aliases as report in the REST Service end point as well.
0 Kudos
by Anonymous User
Not applicable
Original User: rzufelt

Got this working, however, I am also trying to get it to report raster values.

If I set it to onlythese="false", then I get the Pixel and Class values of the raster reported.  However, I also get ALL other layers that happen to overlap.

If I set onlythese="true", values from any other features that overlap (as long as they are in my xml), but do not get the raster values.  Looking in the REST end point, I do not see any "fields" for the raster data set like I do for the others.

Does this mean that I will not be able to limit it to "onlythese" if I want to include the raster data?

Thanks,

R_
0 Kudos
ShannonPankow
Emerging Contributor
Thanks so much for the replies...I must have copied the wrong config.html file because I do have the Identify Widget in there. I went thru and made all the changes I *think* need to be made. I have other widgets that I have configured that are working successfully, it is just this one is a bit more complex. I am now getting the following error when opening the Identify Widget:

A problem occurred while parsing the configuration file widgets/Identify/IdentifyWidget.xml
Error #1085
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

Shannon,

   That error normally means you have made a syntax error in your xml file. You should post what you have for this.
0 Kudos
ShannonPankow
Emerging Contributor
Well, I fixed the syntax error and now it works like a charm! Thanks so much! Now, I am using the
<layers onlythese="false"> selection, and it brings in all the fields from all the layers. What I *want* to do is change what the field names display as...will I need to put this back to "true" and then configure each layer separately?

Thanks,
Shannon
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

Shannon,

   Yes, you will have to specify each field if you want to do an alias for fields. Some people seem to think that this is a lot of work, but you need to consider what fields for which layers you REALLY want returned to the end user.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:
0 Kudos