Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Cannot call method "open"

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cannot call method "open"

    Hello there!!

    Iam working on a project in school, its to create a mobile app. I goes fine, but have been stuck on this problem for i while now.

    I think that it has something with the eventlistener to do, but i dont have any suggestions of thoughts how i can solve that.
    Becouse when i click on the eventlistener a new window could pop up, it does but it contains a error message which says. "Cannot call method "open". I have googled this problem but cant find any defects with the code which look like this:

    LatestTipsLabel.addEventListener('click', function(){
    	"use strict";
    	var LatestWin, LatestInc;
    	LatestInc = require('/latest');
    	LatestWin =  LatestInc;
    	LatestWin.open();
    });
    I create a eventlister..use two variables...require a file to one of the variables, then put that equal to the other one and then open it if you click on the label i created further up in the code!

    It complain that "LatestWin.open" cant be done...i dont know hove to solve it..have posted a simular question on appcelerators own forum but no one knew something about it..so i ask you now!

    All help is greatful!
    Thanks!

    --- Update ---

    The code also looked like this: [CODE]LatestTipsLabel.addEventListener('click', function(e){
    "use strict";
    var LatestWin, LatestInc;
    LatestInc = require('/latest.js');
    LatestWin = new LatestInc.OpenLatest();
    LatestWin.open();
    });[CODE]

    But if i use this code.. i get error on line 60: "Cannot read propery "openLatest" of undefined"


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Cannot call method "open"

    Welcome to the forum! Thanks for taking the time to learn how to post code correctly, once anyway. If you haven't already, please read this topic to learn other useful info for new members.

Similar Threads

  1. Replies: 2
    Last Post: June 22nd, 2013, 10:30 AM
  2. what do they mean "call a method named myInfo"
    By willc86 in forum Java Theory & Questions
    Replies: 7
    Last Post: January 22nd, 2013, 01:42 PM
  3. Can't call "paint" method from other method
    By aslanali555 in forum Object Oriented Programming
    Replies: 8
    Last Post: November 19th, 2012, 05:53 AM
  4. Can't call "paint" method from other method
    By aslanali555 in forum Object Oriented Programming
    Replies: 1
    Last Post: November 17th, 2012, 01:30 PM
  5. Suddenly getting "Too Many Open File" error
    By newbie14 in forum Java Networking
    Replies: 4
    Last Post: December 12th, 2010, 11:12 PM