Select to view content in your preferred language

SFV: Custom Info Window on Roll Over in Search Widget

799
5
07-20-2010 07:27 AM
IrfanClemson
Frequent Contributor
Hi,
I am trying to show a custom datagrid as InfoWindow inside the Search Widget when the user has Mouse Over on the search results records. I have tried to use the code from:
http://resources.esri.com/help/9.3/arcgisserver/apis/flex/samples/index.html?sample=QueryClickInfoWi...

and modified the following function but nothing happens at all:
private function mouseOverRecord(event:MouseEvent):void
   {
    var infoData:Object = event.currentTarget.infoData;
    clearTimeout(hitimer);
    ////hitimer = setTimeout(showHighlight, 800, [infoData]);
    graphicsLayer.clear();
    infoData.IrfGra.symbol = symbol;
    infoData.IrfGra.infoWindowRenderer = myInfoWindowRenderer;
    graphicsLayer.add(infoData.IrfGra);
   }


Note, the Enhanced Search Widget is too much for my needs and hard to implement within my own Search Widget.
May be there is a simpler way to do this?
Thanks!
Tags (2)
0 Kudos
5 Replies
IrfanClemson
Frequent Contributor
Minor correction: Mouse over on the search result does change the symbology (per the ESRI Sample) to dotted lines on the map of the selected (rolled over)  searched item; but still does not show the InfoWindow, which of course the ESRI sample does.
Thanks,
Meengla
0 Kudos
IrfanClemson
Frequent Contributor
I have made some more progress: Using an external .MXML file to 'render' the Info Window per following code. While the new Info Windows show fine but not they are not registering any mouse clicks on them. I have the code for the .mxml file given below as well.
Must be something simple?!

var myRenderer:ClassFactory = new ClassFactory(SearchWidgetDgridIRF);
                    myRenderer.properties = { myTitle : gra.attributes.title };
                    InfoSym.infoRenderer = myRenderer;
                    var callout:Graphic = new Graphic(gra.attributes.point, infoSymbol1);
                    callout.symbol = InfoSym;
                    callout.attributes = gra.attributes;
  graphicsLayer.add(callout);



MXML file:

<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx=   "http://www.adobe.com/2006/mxml" 
    layout=    "absolute" 
    width=    "300" 
    height=    "200"  
    showCloseButton= "true" 
    title=              "Search Results"
    close=    "closeMe()"
    styleName=   "SearchDGCanvas"
    creationComplete= "init()" verticalScrollPolicy="auto" enabled="true">
<mx:VBox  xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
  <![CDATA[
   [Bindable]
   public var myTitle:String;
   
   private function closeMe() :void
   {
    
    
   }
   private function init() :void
   {
    
    
   }
   
  ]]>
 </mx:Script>

<mx:VBox label="{myTitle}" backgroundColor="0xEEEEEE">
                <mx:Label text="OWNER: {myTitle}"/>
               
            </mx:VBox>
 </mx:VBox>

</mx:TitleWindow>

0 Kudos
IrfanClemson
Frequent Contributor
Oh, I see: I cannot interact with the InfoWindow because my Map is in the Search by graphics mode; I need to disable that, I guess.
0 Kudos
CarlosRiano
Emerging Contributor
Hi Meengla

That is exactly what I am looking!!! can you shared this code with me?... I am not good in Flex.. I am just a newbie, I tried and tried but i t is impossible for me right now.

Carlos
0 Kudos
IrfanClemson
Frequent Contributor
Hi Crionopa,
Sorry for this late response--somehow I am not getting email notifications of responses even though I subscribe to Topics. Hmmm.
I actually ended up not implementing the InfoWindow based approach because it was not suitable for my needs (interactivity was needed in my case). Instead, I now have an .mxml file which shows up (as a popup) when mouse is clicked over a Search Result item. This suits me better than the Enhanced Search Widget or the InfoWindow.
Thanks,
Meengla
0 Kudos