Hi Rauf,
I am not able to navigate the two XML views
My index.html is
<script> sap.ui.localResources("ghmanagesystem"); //var app = new sap.m.App({initialPage:"idGHFirst1"}); var page2 = sap.ui.view({id:"idGHLoginForm1", viewName:"ghmanagesystem.GHLoginForm", type:sap.ui.core.mvc.ViewType.XML}); var page = sap.ui.view({id:"idGHFirst1", viewName:"ghmanagesystem.GHFirst", type:sap.ui.core.mvc.ViewType.XML}); var app = new sap.m.App("id1",{pages:[page2], initialPage:"idGHFirst1"}); app.addPage(page); app.addPage(page2); app.placeAt("content"); </script>
GHFirst,controller.xml
onButtonClick : function(){ alert("onButtonClick"); var bus = sap.ui.getCore().getEventBus(); bus.publish("nav", "to", { id : "GHLoginForm", data :{ key : "HI" } }); }
GHLoginForm.controller.xml
onInit: function() { this.getView().addEventDelegate({ onBeforeShow : jQuery.proxy(function(oEvt) { this.onBeforeShow(oEvt); }, this) }); }, onBeforeShow : function(oEvent){ var data = oEvent.data.key; },
I have written this controllers and index file. Please review this code..
Regards,
Prashant