简体   繁体   中英

data-press in view doesn't seems to be working, What am I missing here?

In open ui5 I am using data-custom-data:target = "screenName" in a div and I have created 2 files screenName.view.html and screenName.controller.js, when I click on the div , it does not takes me to the screen which I am expecting ie nothing happens when I click. What am I missing here? Should I need to map the screens some where else?

I have tried the following code on data-press="sometTilePress"

sometTilePress : function(evt) {
    var bus = sap.ui.getCore().getEventBus();
    bus.publish("nav", "to", {
        id : "someHome"
    });
},

but it gives me an error Sorry, we can't navigate you there. Cannot read property 'app' of undefined Sorry, we can't navigate you there. Cannot read property 'app' of undefined .

what am I missing now ?

I am newbie, so don't down vote!

Adding a mapping in App.controller.js helped me to fix the issue. So we need to map it in the said js to make it work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM