Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

message = "'undefined' is not a function (evaluating 'bookview.open()')" in titanium

I'm new to TitaniumMobile and I currently following official tutorials but I struck at doing this stage

function showBook(event) {
    var selectedBook = event.source;var args = {
        title: selectedBook.title,
        author: selectedBook.author
    };
    var bookview = Alloy.createController("bookdetails", args).getView();
    bookview.open();
}      

When I tried to run with ios simulator, I kind of stuck with the above stage and the following error occurs.

  Script Error {
[ERROR] :      backtrace = "#0 () at :0";
[ERROR] :      line = 27;
[ERROR] :      message = "'undefined' is not a function (evaluating 'bookview.open()')";
[ERROR] :      name = TypeError;
[ERROR] :      sourceId = 344963552;
[ERROR] :      sourceURL = "file:///Users/hivelocity/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/6B8062FB-B379-407A-8553-184EED274850/FaveBooks.app/alloy/controllers/index.js";
[ERROR] :  }
like image 487
Naing Lin Aung Avatar asked Jan 10 '23 07:01

Naing Lin Aung


1 Answers

be sure that bookdetails is a window and not a view.

To check, just open bookdetails.xml and check tag of Window is there or not.

like image 141
Mitul Bhalia Avatar answered Apr 09 '23 12:04

Mitul Bhalia