0 Replies Latest reply on Jul 30, 2011 11:06 PM by tooMuchTrouble

    "double clutch" dynamic tooltip

    tooMuchTrouble Level 3

      i have an itemRenderer (code below) that sets a dynamic tooltip, works as expected except once the tooltip is set to a new value, the user needs to mouseover the item twice to see the new data. the user mouseover the tooltip, old data is still shown, they mouseover a second time before they see the new data.

       

      any ideas?

       

      thanks.

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <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="true" fontFamily="arial" fontSize="11"

      toolTip="Double click to select contacts from your address book."

      toolTipCreate="customToolTip(event);">

      <fx:Script>

      <![CDATA[

      import mx.events.ToolTipEvent;

       

      [Bindable] private var contactGroupTxt:String

       

      override public function set data(value:Object) : void {

      super.data = value;

      if (data.selectedCount > 0)

      contactGroupTxt=data.groupName+" ("+data.groupCount+" contacts) (" +data.selectedCount+" selected)";

      else

      contactGroupTxt=data.groupName+" ("+data.groupCount+" contacts)";

      }

       

      private function customToolTip(event:ToolTipEvent): void {

      if (data.selectedCount > 0 && data.groupID !=-1)

      event.currentTarget.toolTip="Selected:\n"+data.selectedList;

      else

      event.currentTarget.toolTip="Double click to select contacts from your address book.";

      event.currentTarget.validateNow();

      }

       

      ]]>

      </fx:Script>

       

      <s:Label height="20" paddingTop="5" text="{contactGroupTxt}"/>

      </s:ItemRenderer>