Select to view content in your preferred language

Spark textArea context menu not working

537
2
01-14-2011 08:34 AM
JasonLevine
Deactivated User
Hello all,
   I have an identify tool in my map set up so that when a use clicks a polygon, an infoWindow appears containing a spark textArea (not mx textArea) that contains the information for that polygon.  The problem I'm having is that none of the context menu tools work and are grayed out (eg: copy, select all etc... see image below).

I found that this is a bug if you have a textArea in a panel :http://kb.yworks.com/article498.html

How would I implement this for the infoWindow so that I can select and copy my text?

Thanks for your help,
Jason
Tags (2)
0 Kudos
2 Replies
JasonLevine
Deactivated User
Here's some sample code from the gallery that I've tweaked to give an example of the problem:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:esri="http://www.esri.com/2008/ags"
      pageTitle="MapClick - click map to get current location">
 
 <fx:Script>
  <![CDATA[
   import com.esri.ags.events.MapMouseEvent;
   import com.esri.ags.geometry.MapPoint;
   import com.esri.ags.utils.WebMercatorUtil;
   
   import spark.components.TextArea;
   
   private function onMapClick(event:MapMouseEvent):void
   {
    var latlong:MapPoint = WebMercatorUtil.webMercatorToGeographic(event.mapPoint) as MapPoint;
    myMap.infoWindow.label = "You clicked at ";
    var textArea:TextArea = new TextArea();
    myMap.infoWindow.content = textArea;
    textArea.text = "Lat/Long is: " + latlong.y.toFixed(6)+ " / " + latlong.x.toFixed(6);
    myMap.contextMenu.hideBuiltInItems();
    myMap.contextMenu.clipboardMenu = true;
    textArea.selectable = true
    textArea.editable = false;
    textArea.mouseEnabled = true;
    myMap.infoWindow.show(event.mapPoint); // "Show the click"
   }
  ]]>
 </fx:Script>
 
 <esri:Map id="myMap"
     mapClick="onMapClick(event)"
     scale="50000000">
  <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
 </esri:Map>
</s:Application>


When you click on the map, you aren't able to copy the text in the textArea window.

Is this a Flex bug? an API bug?  Neither?
0 Kudos
JasonLevine
Deactivated User
No suggestions with this?  If not, is there another way I can create hyperlinks in a infoWindow where I can also select/copy text?

Thanks,
Jason
0 Kudos