Select to view content in your preferred language

popups 2.3.1 and thematic query - Urgent request

1273
5
05-09-2011 12:08 PM
RashidMalik1
Emerging Contributor
First of all, let me say that I love all the enhancements in the newest flex viewer, 2.3.1.  One of my favorites are the enhanced popups.  Here is my issue though.  I am currently using 2.2 flex viewer and have several applications that are running on ArcGIS Server 9.3.1.  I have used the thematic query widget for many of these applications.  However, after clicking on a polygon using the thematic query widget, I would like to use the new poppus instead.  I currently list a few fields and generate a bar chart in the popup.  However, I just want to use the "pick a theme" widget only select a thematic map and a related legend.  I cannot use the dynamic legend feature currently as we have not upgrade to ArcGIS 10 yet.  Being able to do what I just described, would be ideal.  However, here is what will also work:

One of the field in my shapefile has a URL (i.e. www.google.com).  Using the old ThematicQueryWidget, I am able to list that field be it is not clickable as a URL.  Can you please tell me how can I make this field clickable.  I know it would be much simpler with the new popus but I would appreciate someone can tell me how to do this.  But, my first preference is to do what I stated in the first paragraph.  Thanks you so much.....
Tags (2)
0 Kudos
5 Replies
MehulChoksey
Esri Contributor
will submit after more testing tomorrow..
0 Kudos
RashidMalik1
Emerging Contributor
will submit after more testing tomorrow..


Super Mehul.  You are as helpful as ever.  Much appreciated.  Thanks...
0 Kudos
MehulChoksey
Esri Contributor

One of the field in my shapefile has a URL (i.e. www.google.com).  Using the old ThematicQueryWidget, I am able to list that field be it is not clickable as a URL.  Can you please tell me how can I make this field clickable.  I know it would be much simpler with the new popus but I would appreciate someone can tell me how to do this.



Replace infoColumnChartItemRenderer with code below:

<?xml version="1.0" encoding="utf-8"?>
<!--
     ////////////////////////////////////////////////////////////////////////////////
     //
     // Copyright (c) 2010 ESRI
     //
     // All rights reserved under the copyright laws of the United States.
     // You may freely redistribute and use this software, with or
     // without modification, provided you include the original copyright
     // and use restrictions.  See use restrictions in the file:
     // <install location>/License.txt
     //
     ////////////////////////////////////////////////////////////////////////////////
-->
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx"
                autoDrawBackground="false"
                dataChange="itemRenderer_dataChangeHandler(event)">

    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;

            [Bindable]
            private var fieldName:String;
            [Bindable]
            private var fieldValue:String;

            private function itemRenderer_dataChangeHandler(event:FlexEvent):void
            {
                if (data)
                {
                    if (data.alias)
                    {
                        fieldName = data.alias;
                    }
                    else
                    {
                        fieldName = data.field;
                    }
                    
                    
                    if (data.value != null && data.value is String && data.value.substr(0,7) == "http://")
                    {
                        fieldValue = "<a href='" + data.value + "'>" + data.value + "</a>";
                    }else
                    {
                        fieldValue = data.value;
                    }
                }
            }
        ]]>
    </fx:Script>

    <s:layout>
        <s:HorizontalLayout verticalAlign="middle"/>
    </s:layout>

    <s:Label id="field" 
             width="100%"
             text="{fieldName} : "/>
    <mx:Text id="value" 
             htmlText="{fieldValue}"/>

</s:ItemRenderer>
0 Kudos
RashidMalik1
Emerging Contributor
Thanks a billion Mehul.  Will test it shortly.  Thanks..
0 Kudos
RashidMalik1
Emerging Contributor
Worked like a charm.  Thank you so much.  Now I can achieve what I need to achieve...

BTW, in the future, if I wanted to use the 2.3.1 features like new popups and still use the "pick a theme" widget just to switch the theme and legend and clicking on a polygon uses the new poppus not the InfoColumnChartWidget or the InfoColumnChartItemRenderer.  This would be a fantastic if it can be done.  Thanks
0 Kudos