Results 1 to 2 of 2
  1.    #1  
    Hi,

    I need a delay in calling a function, but it doesn't work for me. I found a good topic, where this is described and seems to work:
    https://developer.palm.com/distribut...p?f=11&t=11875

    My code for testing looks like this:
    Code:
    function MainAssistant() {
    
    };
    
    MainAssistant.prototype.setup = function() {
    
      this.controller.setupWidget("btnTest", { }, { label : "Test", buttonClass : "affirmative"} );
      Mojo.Event.listen(this.controller.get("btnTest"), Mojo.Event.tap,
          this.myFunction.bind(this));
    };
    
    MainAssistant.prototype.myFunction = function() {
      this.myDelayFunction().bind(this).delay(2);
    };
    
    MainAssistant.prototype.myDelayFunction = function() {
      Mojo.Log.info("##### Delay working? #####");
    };
    
    MainAssistant.prototype.activate = function(event) {
    
    };
    
    MainAssistant.prototype.deactivate = function(event) {
    
    };
    
    MainAssistant.prototype.cleanup = function(event) {
      Mojo.Event.stopListening(this.controller.get("btnTest"), Mojo.Event.tap,
          this.myFunction);
    };
    When I tap on the button I get an error:
    Uncaught TypeError: Cannot call method 'bind' of undefined, app/assistants/main-assistant.jsjsjs:$13$

    What am I doing wrong?
  2.    #2  
    Ok. Seems like
    this.myDelayFunction.bind(this).delay(2);
    is working as expected (without brackets).

Similar Threads

  1. delay update
    By siderbox in forum Palm Pre and Pre Plus
    Replies: 1
    Last Post: 01/21/2010, 08:24 PM
  2. Ringtone delay
    By Eddieh33 in forum Palm Pixi and Pixi Plus
    Replies: 0
    Last Post: 01/07/2010, 10:45 AM
  3. 6 second delay after 1.3.1...
    By twizardt in forum Palm Pre and Pre Plus
    Replies: 0
    Last Post: 11/20/2009, 03:50 PM
  4. Ring Delay
    By Katahdin in forum Palm Windows Mobile Devices & Apps
    Replies: 7
    Last Post: 12/08/2006, 04:00 PM
  5. Delay nightmare....
    By cierra in forum Palm OS Devices & Apps
    Replies: 1
    Last Post: 03/02/2005, 12:07 PM

Posting Permissions