Pop-up Windows in Flex Viewer 2.3

4858
20
04-29-2011 09:38 AM
GregoryPierce
New Contributor II
Hi everyone,
I am wondering if anyone can help me with this.  I have been trying for a few days now get the pop-up windows working in version 2.3 and have been having some trouble.  Below is my config.xml and pop-up.xml code for the operational layer.  The layer shows up fine in the viewer, I just can't get any pop-up window to show up when I click on the layer.  Any help would be much appreciated, thanks. 

Here is the operational layer data for the config.xml file.

            <layer label="GPS Points" type="dynamic" visible="false"
                   popupconfig="popups/PopUp_GPSPoints.xml"
                   url="http://gisserver/ArcGIS/rest/services/GPSPoints/MapServer/"/>

And here is the PopUp_GPSPoints.xml file in it's entirety.

<?xml version="1.0" ?>
<configuration>
    <title>GPSPoints</title>    
    <fields>
        <field name="Name" alias="Name" visible="true"/> 
        <field name="Orig_File" alias="Original File" visible="true"/> 
    </fields>  
</configuration>

<!--
    Pop-up configuration file for:
    http://gisserver/ArcGIS/rest/services/GPSPoints/MapServer/
-->


Greg Pierce
GIS Specialist
Weber Basin Water Conservancy District

					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
Tags (2)
0 Kudos
20 Replies
RobertScheitlin__GISP
MVP Emeritus
Greg,

   When you are applying PopUps to a dynamic layer then you have to use sublayers

<layer label="GPS Points" type="dynamic" visible="false"
url="http://gisserver/ArcGIS/rest/services/GPSPoints/MapServer/">
    <sublayer id="0" popupconfig="popups/PopUp_GPSPoints.xml"/>
</layer>
0 Kudos
GregoryPierce
New Contributor II
Thanks for your quick response.  When I change the code to represent that, I am now getting an error that looks like this in the viewer:

http response status: 200

Fault code: Client.CouldNotDecode

Fault info: Error #1085

Fault details: null

If I remove the last line of code in the example you supplied me with: </layer>, the error disappears, but I return to the point of not being able to get a pop-up window.  I know I'm doing something wrong.  Any further help is really appreciated.  Thanks.


Edit:  I got it to work!  Thanks!  For some reason when copied and pasted just that line of code: </layer> from the original xml file that had the demographic data in it as an example it did not work.  But if I copied the whole layer data from that demographic layer, and then just modified it to fit my needs, it worked!  Thanks for your help Robert!  In addition I have one more question...  So in that particular map service there is only the one layer and that layer would have a default sublayer value of "0", correct?  In addition I am also bringing in other map services as operational layers that have multiple layers within them, ie: a secondary water map service that has valves, turnouts, pipelines, drains, etc.  How do i determine which number those are?  Should I start with "0" and move my way down the layers as they are organized in the map service mxd?  Thanks again for your help.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Greg,

   Just throw http://gisserver/ArcGIS/rest/services/GPSPoints/MapServer into your web browsers address bar and hit enter, and that will take you to the REST service directory for that map service and all the info you need is there.
0 Kudos
GregoryPierce
New Contributor II
Awesome!  Thank you so much!  You're a lifesaver!
0 Kudos
GregoryPierce
New Contributor II
Sorry to bother you again, but would you have any idea why some of my field values are not showing up in the pop-up window.  The field is listed there but there is no value associated with it and I know there must be for the feature to even be symbolized.  Case in point: our pipelines are symbolized based on a diameter field, so I know there is a value there, but when I add that diameter field to the pop-up xml file the field is listed in the viewer but there is no value next to it.  It is happening with a few different fields, and they vary from text fields to numerical.  It's not happening with all the fields, some values are showing up just fine, it's just these few.  If you'd like me to post any of the code, let me know.  Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Greg,

    Best suggestion is to find one of those features that is not showing what is expected and determine the value of some unique field that way you can go to the REST service page and query that layer using that field and value and see what ArcGIS Server is returning for that record. If the query is returning null values also then open the MXD that the map service is coming from and Identify that feature to double check that there are actually values there.
0 Kudos
GregoryPierce
New Contributor II
Robert,
Ok, simple fix, apparently when I was putting in the fields into the pop-up xml file i didn't pay to close attention to whether those fields were in upper case or lower case letters.  I had the diameter field typed as "Diameter" when in my database it is actually "DIAMETER".  I never would have thought that mattered.  Oh well, live and learn.  Thanks for your help again, have a good weekend.
0 Kudos
NickDeMerchant
New Contributor
Hi guys,

I'm also having an issue with the popup...when I followed your thread, everything seems ok in my code..

<operationallayers>               
           <layer label="Property" type="dynamic" visible="true" alpha="0.7"
                url="http://jdistjwnt815/ArcGIS/rest/services/iPad_Property/MapServer"/>

           <layer label="NBSR" type="dynamic" visible="true" alpha="0.7"
         url="http://irvmonwnt767/ArcGIS/rest/services/NBSR/MapServer"/>
  <sublayer id="3" popupconfig="popups/PopUp_bridge.xml"/>
        </operationallayers>


I as well, get error when having the </layer> in there.  When taking out, no prob.  My config file code is below...any suggestions?

<?xml version="1.0" ?>
<configuration>
      <title>Bridge</title>
      <fields>
      <field name="Bridge" alias="Mile Marker:"/>
      <field name="SUB" alias="Section:"  visible="true"/>
    </fields>
</configuration>

Thanks,

Nick
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nick,

   You are having the same issue as most that are unfamiliar with XML syntax.

Here is the corrected code:

<layer label="NBSR" type="dynamic" visible="true" alpha="0.7"
         url="http://irvmonwnt767/ArcGIS/rest/services/NBSR/MapServer">
  <sublayer id="3" popupconfig="popups/PopUp_bridge.xml"/>
</layer>
0 Kudos