Child pages
  • fluid.event.identifyListener

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Include Page
sneak peek warning
sneak peek warning
Wiki Markup
{include:sneak peek warning}
{div:class=api-page}

h1. fluid.event.identifyListener(listener)
{section}
{column:width=70%}
Returns the unique identifier of the given listener. If the listener has none, one will be added and returned.
{code:javascript|borderStyle=none|bgColor=white}
fluid.event.identifyListener(listener);
{code}
*File name:* {{Fluid.js}}

h2. Parameters

{span:class=borderless-table}
|*{{listener}}*| (Function) description |
{span}

h2. Return Value
{span:class=borderless-table}
|*integer*| The unique identifier allocated to this listener. |
{span}

{column}

{column:width=5%}
{column}

{column}
h3. See Also
* [fluid.allocateGuid]
{column}
{section}
----

h3. Notes

The guid of a listener can be used...


h3. Example
{code:javascript}
fireSpec.guids[fluid.event.identifyListener(listener)] = record;
    ...

var guid = fluid.event.identifyListener(listener);
if (fireSpec.guids[guid]) {
    var rec = fireSpec.guids[guid];
    ...
}
{code}
In this example, the identifier of the listener is used to register a record of information about the listener. Later, the guid of a listener is used to check whether or not a record exists for the listener before action is taken using it.

{div}