Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Declarative configuration is also the preferred approach for supplying arguments related to this component's DOM elements to Invokers and Event Listeners, as shown in the following example:

...

Code Block
javascript
javascript
that.locate(name, localContainer);

The locate() method retrieves the specified DOM node by querying the DOM.

(For information about parameters , for this and other DOM Binder functions, see DOM Binder API.)

...

Code Block
javascript
javascript
that.dom.fastLocate(name, localContainer);

The signature and function of fastLocate are exactly the same as that for locate. The difference is that fastLocate() method retrieves the DOM node from the DOM Binder's cache instead of querying the DOM directly: When fastLocate() is used instead of locate(), if the results of the search are already present in the DOM binder's cache, they will be returned directly without searching the DOM again. This can be very much more rapid, but runs the risk of returning stale results. The DOM binder's cache is populated for a query , whenever a query is submitted via locate().

...

Code Block
javascript
javascript
that.dom.refresh(names, localContainer);

The refresh() method refreshes the cache for one or more selector names, ready for subsequent calls to fastLocate(). It functions exactly as for a call to locate() except that

...

In this example, the implementer is using element IDs to identify the text and edit fields. (Because a custom editContainer is not supplied, it will default to the selector .editContainer declared by the component.)

To access the DOM elements, the Inline Edit component uses its DOM Binder and the selector names:

...