www.webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home Resources API Reference Mojo.Event.listenForFocusChanges(node, handler)

Mojo.Event.listenForFocusChanges(node, handler)

This function can be used to listen for changes in which element has focus inside the specified node.

A listener object is returned which implements a stopListening() method. This can be called tp permanently cancel the listener, removing its event listeners.

Parameter Type Description
node   Node on which to listen for events
handler Function Function called when focus changes.  Passes the newly focused element or null.

 Example usage:

        this.controller.setupWidget('emailAddress', this.emailAttributes, this.emailModel);
                
        $('emailAddress').observe(Mojo.Event.propertyChange, this.emailChanged.bind(this));
        this.emailFocusHandler = this.emailHandler.bind(this);
        Mojo.Event.listenForFocusChanges($('emailAddress'), this.emailFocusHandler);
 

0 Comments

    Add Comment


      • >:o
      • :-[
      • :'(
      • :-(
      • :-D
      • :-*
      • :-)
      • :P
      • :\
      • 8-)
      • ;-)