开发者

errorTip on Flex ComboBox

I have a tooltip on a ComboBox but I much prefer the styling of the errorTip (with the "tail")开发者_运维百科.

I have replaced the tooltip with an errorTip, but now the ComboBox has a red border.

I'm still pretty much a newb... is there a way to override the red border on the ComboBox so that its' border is back to good ol' black?

thanks,

Mark


You'd probably want to create your own custom tooltip as errorTip is reserved for the validation system.

There's some info here about how to create your own. It's fairly straightforward if you want something simple.


Here's something I've used in the past:

The Actionscript:

private var infoToolTip:ToolTip;
private function showToolTip(evt:MouseEvent, text:String):void
{
  var pt:Point = new Point(evt.currentTarget.x, evt.currentTarget.y);

  // Convert the targets 'local' coordinates to 'global' -- this fixes the
  // tooltips positioning within containers.
  pt = evt.currentTarget.parent.contentToGlobal(pt);

  infoToolTip = ToolTipManager.createToolTip(text, pt.x, pt.y, "errorTipAbove") as ToolTip;
  infoToolTip.setStyle("borderColor", "#87B846");
  infoToolTip.setStyle("color", "white");
  var yOffset:int =  infoToolTip.height + 5;
  infoToolTip.y -= yOffset;
  infoToolTip.x -= 5
}

// Remove the tooltip
private function killToolTip():void
{
  ToolTipManager.destroyToolTip(infoToolTip);
}

Using the toolTip:

<mx:Image source="{myImageSource}" mouseOver="showToolTip(event, 'Hello there!')" mouseOut="killToolTip()" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜