Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Navigation in sap.m

$
0
0

Hi experts,

 

 

In  my created two views and layouts for them. 

what i need is i want display second view layout in first view

 

first.view.xml

 

<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:l="sap.ui.layout"

  controllerName="login.first" xmlns:html="http://www.w3.org/1999/xhtml">

  <Page title="Title">

  <content>

     <VerticalLayout id="firstlayout">

         <Button text="Click" press="navigate"></Button>

     </VerticalLayout>

    

 

  </content>

  </Page>

</core:View>

 

first .controller.js

 

navigate : function(){

this.byId("firstlayout").removeAllContent();

this.byId("firstlayout").addContent(sap.ui.getCore().byId("secondlayout"));

}

 

 

second.view.xml


<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:l="sap.ui.layout"

  controllerName="login.second" xmlns:html="http://www.w3.org/1999/xhtml">

  <Page title="Title">

  <content>

      <VerticalLayout id="secondlayout">

         <Button text="Second View" ></Button>

     </VerticalLayout>

 

  </content>

  </Page>

</core:View>


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>