AnsweredAssumed Answered

Showing an Image based on a condition on an InfowindowRender

Question asked by geonetadmin on Jul 19, 2011
Latest reply on Jul 20, 2011 by geonetadmin
Original User: sravabonagiri

Hi Folks,

Please help me with my situation. I am using an InfoWindowRenderer to show a window on a mouse click. I did this on a Feature layer. I was able to do the basic data binding from the feature layer without any issues. However, I have an issue displaying an Image inside the info window based on a condition. I have two scenarios, one is, if the water quality is good at a beach location, then I would like to show the swim image. In the other scenario, if the water has elevated bacteria levels, then I would like to show no-swim image. I attached an image and the code associated with my work. Could you please help me out. I appreciate in advance.

Here is the associated code:
<esri:FeatureLayer id="fLayer"
  outFields="[GIS.Samplets_Join.BEACH_NAME, GIS.Samplets_Join.ADVISORYFROM,     
                                GIS.Samplets_Join.ADVISORYTO, GIS.STATION.DATE_COLLECTED,
                                GIS.STATION.STATUS]"
  graphicAdd="fLayer_graphicAddHandler(event)"
  url="http://hostname/ArcGIS/rest/services/WaterQualityMonitoringApp/MapServer/0" >
     
     
  <esri:infoWindowRenderer>
   <fx:Component>
    <mx:VBox backgroundColor="0xffffff" width="100%" height="100%"
     color="#5588a6" label="{data['GIS.Samplets_Join.BEACH_NAME'].toString().toUpperCase()}">      
        
  
     <mx:Label text="from {data['GIS.Samplets_Join.ADVISORYFROM']} to {data['GIS.Samplets_Join.ADVISORYTO']}"/>
     <mx:Image source='assets/swimokgraphic.PNG'/>
     <mx:Label text="Date of Test: {data['GIS.STATION.DATE_COLLECTED']}" />
     <mx:LinkButton id="lnkButton" label="Frequently Asked Questions" fontWeight="bold" textDecoration="underline" />
    </mx:VBox>
   </fx:Component>            
  </esri:infoWindowRenderer>     
</esri:FeatureLayer>

Attachments

Outcomes