View Source

h2. Overview
_Since 3.0_

The tooltip component is used to pop up a tooltip for another component. You can specify various positions and effects for the tooltip.

{tip}See the ICEfaces Showcase [Live Demo|http://icefaces-showcase.icesoft.org/showcase.jsf?grp=aceMenu&exp=tooltipOverviewBean] of this component, complete with source code.{tip}

h2. Getting Started
{panel}
{code:xml|borderStyle=dashed} <h:outputText id="text" ... />
...
<ace:tooltip for="text" ... >
...
</ace:tooltip>
{code}
{panel}
h2. Attributes
{tip:title=TagLib Documentation}This section covers attributes involved in the typical use-cases for this component. For reference, the complete taglib documentation for this component is available [here|http://www.icefaces.org/docs/v4_latest/ace/tld/ace/tooltip.html].{tip}
{panel}
*for:* id of the component that the tooltip is for.
{panel}
{panel}
*position* and *targetPosition* are used to position the tooltip relative to the target component, e.g. "topLeft" corner of tooltip at "bottomRight" corner of target component.
{panel}
{panel}
*showEvent*, *showDelay*, *showEffect*, *showEffectLength* specify the event and effect to show the tooltip.
{panel}
{panel}
The corresponding attributes for hiding the tooltip are *hideEvent*, *hideDelay*, *hideEffect*, *hideEffectLength*
{panel}
h2. Event Listeners
| displayListener | A server side listener to be invoked when the tooltip is about to be shown in the client. |

h2. Client Behavior Events
| display | Fired before the tooltip is shown (default event). |

h2. JavaScript API

h4. ICEfaces 3.x

The client side component object is exposed through the global variable name specified in the *widgetVar* attribute.

h4. ICEfaces 4+

The "widgetVar" attribute on the ACE components has been removed in ICEfaces 4 and in its place a new "ice.ace.instance()" client JavaScript object lookup API has been introduced. The reason for this change is to enable lazy-initialization of the ACE component JavaScript objects to improve runtime performance and reduce browser memory use.

{code}var widget = ice.ace.instance('frm:componentId);{code}

{tip}The _ice.ace.instance_ function requires the _full_ client id of the component to be specified, such as "j_idt77:componentId" instead of just "componentId". To reduce the complexity of working with complete IDs with this function it may be preferable in some cases to use {{prependId="false"}} in the enclosing form (e.g. _<h:form prependId="false">_).{tip}

{info}This component doesn't have a client-side API made specifically to be used by application developers. However, the component's internal methods and variables can be accessed in this way, including the underlying jQuery object and objects from underlying Javascript libraries (if applicable), and can be used for whatever purpose a developer might have in mind.
{info}

h2. Keyboard and ARIA Support

The following ARIA roles are supported: alert.

h2. Advanced Example
{code:xml|borderStyle=dashed}
<ace:tooltip id="tooltip" for="content"
speechBubble="true"
showEffect="slide"
hideEffect="fade"
showDelay="100"
hideDelay="500"
position="bottomLeft"
targetPosition="topRight"
showEffectLength="300"
hideEffectLength="300">
<!-- content -->
</ace:tooltip>
{code}

h2. CSS Classes

The following markup represents the basic HTML structure of the component and the CSS classes it uses.

{code:xml}
<div class="qtip qtip-pos-tr ui-helper-reset ui-widget ui-tooltip qtip-fixed ui-widget-content ice-ace-tooltip ui-corner-all [user defined classes]" style="[user defined styles]">
<div class="qtip-tip"><canvas></canvas></div>
<div class="qtip-content ui-widget-content ui-tooltip-content">
<!-- Tooltip content -->
</div>
</div>
{code}
h2. Known Issues

None.

h2. Other Notes

{panel}
This component can be used in delegate mode. For more information, visit this [page|http://www.icesoft.org/wiki/display/ICE/Delegate].
{panel}

h2. Additional Resources