TypeError: Result of expression 'item' [undefined] is not an object.

Hello

I can userstand the good way to spend the ListItemData given to a page entry. In the example ListView generated here is what is generated.

import bb.cascades 1.2
NavigationPane {
    id: nav
    Page {
        Container {
            ListView {
                dataModel: XmlDataModel {
                    source: "data.xml"
                }
                onTriggered: {
                    if (indexPath.length > 1) {
                        var chosenItem = dataModel.data(indexPath);
                        var contentpage = itemPageDefinition.createObject();
                        contentpage.itemPageTitle = chosenItem.name
                        nav.push(contentpage);
                    }
                }
                accessibility.name: "Listing"
            }
        }
    }
    attachedObjects: [
        ComponentDefinition {
            id: itemPageDefinition
            source: "ItemPage.qml"
        }
    ]
    onPopTransitionEnded: {
        page.destroy();
    }
}
import bb.cascades 1.2
Page {
    property alias itemPageTitle: titlebar.title
    titleBar: TitleBar {
        id: titlebar
    }
    Container {
    }
}

If I wanted to copy the input data to the push page, then I can do that.

import bb.cascades 1.2
NavigationPane {
    id: nav
    Page {
        Container {
            ListView {
                dataModel: XmlDataModel {
                    source: "data.xml"
                }
                onTriggered: {
                    if (indexPath.length > 1) {
                        var chosenItem = dataModel.data(indexPath);
                        var contentpage = itemPageDefinition.createObject();
                        contentpage.item = chosenItem
                        nav.push(contentpage);
                    }
                }
                accessibility.name: "Listing"
            }
        }
    }
    attachedObjects: [
        ComponentDefinition {
            id: itemPageDefinition
            source: "ItemPage.qml"
        }
    ]
    onPopTransitionEnded: {
        page.destroy();
    }
}
import bb.cascades 1.2
Page {
    property variant item
    titleBar: TitleBar {
        id: titlebar
        title: item.name
    }
    Container {
    }
}

And this also works except that it generates a

TypeError: Result of expression 'item' [undefined] is not an object.

error. Thus, it is written in the ebook learn Blackberry App Development 10. Anyone know how to get this to work without him spit the error type?

Thank you

the problem is that the point is not defined when the page is created.
a solution would be to use onItemChanged to set the title.
or use something like element? Item.Name;
There are many other possible solutions, but these two come to mind that the easier.

Tags: BlackBerry Developers

Similar Questions

  • Error in management: TypeError: result of expression 'blackberry.media' [undefined] is not an object

    I'm taking pictures in my widget, but when I make the call

    blackberry.media.camera.takePicture (successCB, closedCB, errorCB);

    I got this error in the Simulator as well as in a real device: "error in management: TypeError: result of expression 'blackberry.media' [undefined] is not an object.

    Also, I included the function in the config.xml file:

    I don't know what else could be.

    Hello

    I have not a 9360 around me at the moment, but I just tried it on a 9900 7.0 running and the above code ran very well.

    On your device, could you please navigate:

    Options > device > application > search and highlight her is > press the menu key, then select change permissions > set all allow (or as high as possible) > save options and re-run your application under test.

    It is more of a longshot, but get a little creative.

    Also, you use the latest version of the SDK software (2.3.1) smartphone while packing?

    https://bdsc.webapps.BlackBerry.com/HTML5/download/SDK

    I'll try and think a little more ideas, but the above code should work on a device of 7.0. Maybe someone from the community can check on them?

    Erik Oros

    BlackBerry Development Advisor

  • TypeError: Result of Expression

    TypeError: Result of expression 'blackberry.push.openBISPushListener' [undefined] is not a function.

    This code is directly from the API documentation.  So what is wrong?

    
    
        
            
            Push Listener
    
        
        
            
    bbwp "c:\applications\devBlog\devBlog.zip" /g 
    

    will suffice

  • "TypeError: undefined is not an object ' after the 2014.1.1

    I see the error: "TypeError: undefined is not an object (evaluation of"cpoint.getSymbolElement") in a composition of _upgraded that arouses points and tooltips to not appear in the charged composition.»

    Animate edge version 2014.1.1

    Mac OS 10.10.1

    Safari 8.0.2, 40.0.2214.94of Chrome, Firefox 35.0.1

    This question has started to happen after 2014.1.1 updated

    No changes have been made to my computer and I tested it on other computers with the same result

    Here is the improved composition that does not work: http://inlightmedia.com/edge-interactive-svg-maps_upgraded/

    Older composition which displays correctly the pins and ToolTips: http://inlightmedia.com/edge-interactive-svg-maps/

    Two compositions zip files: Zip file

    I strongly am a rookie Edge and JavaScript and have been amend this (which was created by someone else is no longer supports) according to my needs. Any help is at work in the new version of edge would be greatly appreciated.

    Thank you
    Jansen

    Hello

    It's compositionReady, the #34 line:

    You've written: var = cpoint sym.createChildSymbol ("point", "stage");

    and it was: var sym.createChildSymbol = cpoint ("point","STagus");

    step must be capitalized: stage.

  • MuseJSAssert: Error calling the function switch: TypeError: undefined is not an object (evaluation of "a.rules")

    I have this error on my Web site every time that I go. It disappears when I refresh three times.

    "MuseJSAssert: error calling the function switch: TypeError: undefined is not an object (evaluation of"a.rules").

    I downloaded the site with Filezila.

    Please help, what's wrong here?

    Thank you

    Hi Barbara,

    The question began to happen after you downloaded using the latest version of Muse?

    If so, can you try to remove the old files of the web server and re-upload using Muse?

    Kind regards

    Akshay

  • BBUI.js action bar problem press button menu contextual assessment "undefined is not an object.

    I was updating my file bbui.js to the latest version and my screen splash action bar buttons are now broken when I deploy my Dev Alpha b with the updated OS 10.2. However, when I imitate the ripple app, there is no error message and everything works.

    When I open web-insector to see what the console bed after I pressed a button:

    "TypeError: 'undefined' is not an object (evaluation of"blackberry.ui.contextmenu.CONTEXT_ALL").

    I have a button in the context menu which worked very well forward on each of the pages.

    All my code is available for viewing at https://github.com/InnovateorDieOnline/BOTE

    Thank you in advance.

    Hi there, don't you update extension WebWorks (described in the components section required here.)
    https://github.com/BlackBerry/bbUI.js/wiki/context-menus

    The latest version of bbUI.js handles the Menu differently and you will need to make some changes, in addition to updating the script files.

  • 'undefined' is not an object ("new blackberry.pim.contacts" evaluation)

    Hi, I'm working on the PIM contact. I did the CPO. That works well, but when I put implement this code in my project, I am getting following error

    TypeError: 'undefined' is not an object ("new blackberry.pim.contacts" evaluation)

    He comes to
    findOptions = new blackberry.pim.contacts.ContactFindOptions ();

    I added also permission

    <>ermissions >

    <>Ermit > access_pimdomain_contactsermit >

    ermissions >

    Any help

    I have error. To add the function id in the config file.

    I forgot that part.

  • Shape layers: Undefined is not an object

    I used rd_GimmePropPath to get the names of Match for the properties of the form, but I get an error "undefined is not an object ' by using the following:

    App.Project.Item (1). Layer ("Shape"). ("ADBE vectors root group") ("ADBE Vector - Ellipse shape") ("" ADBE Ellipse Position Vector "') .setValue (-535,-311);

    No indication to access the properties of shape layer via script would be appreciated.

    You still get the error "undefined is not an object"?

    I might break into pieces and see where you get the error:

    myLayer = app.project.item var (1) .layer ("Pinky");

    var temp1 = myLayer.property ("ADBE vectors root Group");

    Temp2 var = temp1.property ("ADBE Vector Group");

    temp3 var = temp2.property ("ADBE vector Group");

    TMP4 var = temp3.property ("ADBE vector shape - Ellipse");

    temp5 var = temp4.property ("ADBE vector Position Ellipse");

    temp5. SetValue ([-535,-311]);

    Dan

  • Undefined is not an object

    Hello

    I'm having a problem with a panel of HTML5 for Premiere Pro.  I have the Panel installed on 15 computers and it works fine on 10 of them.

    On the other 5, launches the Panel, but when you press a button/script an alert box stands up and says "Undefined is not an object.

    Any ideas?

    Thank you

    Kelly

    In additional tests and subsequent updates of creative cloud, I could not the failure of the installation of your .zxp. Please send again if the problem reappears.

  • Error 21. Undefined, is not an object. Can't get management to work

    When I try to use picture frames, I get this message... Error 21. Undefined is not an object

    Harold, it seems that the bug has not been fixed, but I worked on a temporary fix for this issue. See my comment to you in the other post about it:

    error message 21 under filter/rendering/image

  • How to deal with the "undefined is not an object"?

    I'm easy to a solution, but stepped on a thumbtack:

    The following code snippet creates an error in the GetTplParams function

    var template = "DDD-BibFM-tpl.fm";  // located in script-dir var outFile  = "DDD-BibFM.fm";      // located in the source dir   oDoc = OpenTemplate (); alert ("Is template open now?"); function OpenTemplate () {   var tplDir, tplFile, openParams, openReturnParams, oFile;   tplFile = "E:\\_DDDprojects\\FM+EN-escript\\escript\\DDD-BibFM-tpl.fm" // SimpleOpen does not take the tplFile, but opens the dir of the active document //  oFile = SimpleOpen (tplFile, true);   openParams = GetTplParams ();    openReturnParams =  new PropVals();    oFile = Open (tplFile, openParams, openReturnParams);    return oFile; }   function GetTplParams() {  // =>>> "undefined is not an object" on line 22 var params, i;  // Change the params   i = GetPropIndex(params, Constants.FS_RefFileNotFound);    params[i].propVal.ival = Constants.FV_AllowAllRefFilesUnFindable;    i = GetPropIndex(params, Constants.FS_FileIsOldVersion);    params[i].propVal.ival = Constants.FV_DoOK;    i = GetPropIndex(params, Constants.FS_FontNotFoundInDoc);    params[i].propVal.ival = Constants.FV_DoOK;    i = GetPropIndex(params, Constants.FS_LockCantBeReset);    params[i].propVal.ival = Constants.FV_DoOK;    i = GetPropIndex(params, Constants.FS_FileIsInUse);    params[i].propVal.ival = Constants.FV_OpenViewOnly;    i = GetPropIndex(params,Constants.FS_AlertUserAboutFailure);    params[i].propVal.ival=Constants.FV_DoCancel;  /*   i = GetPropIndex(params,Constants.FS_MakeVisible );    params[i].propVal.ival=false;  */   return (params);  }
    

    (insertion of JS code really has its quirks in this editor).

    Hi Klaus,

    Something like this in the GetTplParams() service you:

    params = GetOpenDefaultParams();

  • error in Java script "undefined is not an object.

    Dear all,

    IM using InDesign CS4. Im trying to remove managers of anchor text. but I got the error msg "undefined is not an object. Here's my code for the part.

    app.findGrepPreferences.findWhat = "AQ\\d +";

    myFoundItems = app.findGrep ();

    var myLen = myFoundItems.length;

    for (var i = myLen-1; i > = 0; i--) {}

    Alert (myFoundItems [i]. (Happy);

    var a = app.select (myFoundItems [i] .parentTextFrames);

    a.Remove ();

    }

    Please help someone.

    Thank you

    Selva

    Hi Marijan

    Unfortunately, this is not correct, because "parentTextFrames" is an array of blocks of text, so this will fail. Maybe something like this:

    myFoundsItems[i].parentTextFrames[0].remove();
    

    It works!

    Thank you very much. I also thank Ariel for his work.

    That kind of you.

    Wow.

    Selva

  • TypeError: Result of expression 'new blackberry.invoke' [undefined] is not an object. Application of bbUI

    I am facing an error during the use of the blackberry and the blackberry.invoke feature, invoke. BrowserArguments

    I have a group of items in an imageList, an element is defined as this line

    Minutes from anywhere

    function openUptownCairoLink() {}

    try {}

    var args = new blackberry.invoke.BrowserArguments ('http://blackberry.com');

    BlackBerry.Invoke.Invoke (blackberry.invoke.APP_BROWSER, args);

    } catch (e) {alert (e)}

    }

    and when I click on the element, it warns the error as in the subject of this topic.

    I'm using BB Bold 9900 with OS 7

    You will need to do the following:

    http://192.168.0.140:8888" subdomains="true">
      
      
      
      
      
      
      
      
      
      
    
    
  • JavaScript exception: error calling the selection function: TypeError: undefined is not an object ('jQuery.browser.msie' assessment)

    Hi all

    my site www.theperthcollective.com is this error on the only secure site (https) on the Tickets Page Workshop tickets

    With ' some files on the server may be missing or incorrect. Clear the browser cache and try again, if the problem persists please contact the author of the Web site.

    Also the Mumblr widget does not work on the secure site.

    Can anyone help? IM at my wits end. I've tried everything I can think of and nothing worked. It is hosted with GoDaddy.

    Thank you

    Hayley

    Have you actually checked it in different browsers? with which browser you test? Since it specifically points to MSIE, this could be a fluke due to browser being obsolete...

    Mylenium

  • Of ERROR APPEARS WHEN I LAUNCH MUSE SITE IN BROWSER: MuseJSAssert: error calling the function switch: TypeError: undefined is not an object ('jQuery.browser.msie' assessment)

    Hello

    I am at a loss why I get this error - I thought it might be hyperlinks on the page so I stripped all the links page to other pages I've had more than a month to is rearranged pages - and even removed from the homepage and glued in place - but this issue has not changed - how bad can I turn this extra - the error is so vague and make no mention of what that either I can target - any advice would be welcome.


    Jay

    Please try to re - publish the site, download all the files manually using any FTP client and then check.

    If still the same issue, we provide the url of the site.

    Thank you

    Sanjit

Maybe you are looking for

  • TYPING NON-CLAVIER PROBLEM

    I have a weird problem. The tiny 'o' button, the DELETE key and the forward arrow key don't work. Nothing happens. IT IS NOT A PROBLEM WITH THE KEYBOARD. I tried several keyboards as well as the keyboard Viewer, and none of them does not work, either

  • Install thin do not want to install drivers for a new X 220?

    We have just received some new X 220 and I've updated the drivers with Update Retriever. When I run install thin, it works but then did a reboot and just after he does nothing and nothing changed either. The newspaper is weird because I don't see why

  • WRT1900AC and OpenVPN with Macbook Pro

    I'm trying to set up a VPN connection to my home network so I can access the shares on a WD My Cloud EX2 NAS device when I am absent in the same way as when I'm home and connected to the network.  Here is where I am: I have installed successufully Tu

  • New PC, 0xC004C008 activation error, cannot use the phone activation

    Hello I had professional retail of Windows 7 on my laptop, the motherboard is dead in and I bought your desktop PC instead, now I get an error of activation 0xC004C008, I tried to call the phone automated system in my country, but he speaks in a lang

  • I was several years Member of the cc to my small laptop, but now I bought a new Imac stationary.

    I had CC subscription for a few years to my little portable. But now I have also bought me a stationary IMac 27 "screen so that I can work better, so I use my laptop when I travel and so forth.So my it comes If this CC subscription I have, is as well