Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8902

Re: AppBuilder Page Navigation

$
0
0

Hi Jay.

 

In the App.Controller.js (open App.view.html and click on source) change the default navToHandler function to:

navToHandler : function(channelId, eventId, data) {

        if (data && data.id) {

            if (this.app.getPage(data.id) === null) {

               this.app.addPage(sap.ui.htmlview(data.id, "view." + data.id));

               SAP.Util.decorateView(this.app);

            }

            this.app.to(data.id, data);

        } else {

            jQuery.sap.log.error("nav-to event cannot be processed. Invalid data: " + data);

        }

    },

 

And then you can use the event bus like this:

onButtonPress: function(evt) {

        var bus = sap.ui.getCore().getEventBus();

        bus.publish("nav", "to", { id : "newPage" });

    },

 

Regards,

Charl


Viewing all articles
Browse latest Browse all 8902

Trending Articles