Results 1 to 3 of 3

Thread: [SOLVED] Uncaught TypeError: Cannot call method 'addChangeListener' of undefined

  1. #1
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default [SOLVED] Uncaught TypeError: Cannot call method 'addChangeListener' of undefined

    I am trying to add a listener to my Zimlet using the following
    Code:
    var signit = appCtxt.getSettings().getSetting(SIGN_MAIL_PREF);
    signit.addChangeListener(new AjxListener(this, this._signChanged, [signMenu]));
    but when I re-fresh the page in the debug window I see the 'addChangeListener' undefined message. What causes that ? I have a 'new' AjxListener so why would it not be defined ? Thanks.
    Last edited by uxbod; 06-12-2012 at 07:39 PM.

  2. #2
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    Did you define SIGN_MAIL_PREF as a String containing "SIGN_MAIL_PREF"?
    If not, then the line should be :
    var signit = appCtxt.getSettings().getSetting("SIGN_MAIL_PREF") ;

  3. #3
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Quote Originally Posted by tdesorbaix View Post
    Did you define SIGN_MAIL_PREF as a String containing "SIGN_MAIL_PREF"?
    If not, then the line should be :
    var signit = appCtxt.getSettings().getSetting("SIGN_MAIL_PREF") ;
    signit was not being defined as deeper down the chain an error was being thrown. Once I resolved that problem the variable assignment work and the listener was created. Thanks.

Similar Threads

  1. keySequence is undefined
    By tailgate89 in forum Error Reports
    Replies: 13
    Last Post: 12-07-2010, 12:43 AM
  2. ZmBriefcase is undefined
    By archie.federico in forum Error Reports
    Replies: 0
    Last Post: 11-11-2010, 10:51 PM
  3. Replies: 0
    Last Post: 11-24-2009, 04:38 AM
  4. uncaught exception: AjxException
    By jmardones in forum Zimlets
    Replies: 2
    Last Post: 01-22-2008, 02:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •