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

Change Content by URL-Route without SplitApp

$
0
0

Hi all,

 

I have an app defined by a XML-View. In this app I want to change to content of NavContainer "nc_previewContent" after the URL ...#preview is called. How can I do this?

 

index.html:

                                  

 

./views/app.view.xml:

 

<mvc:View        xmlns:mvc="sap.ui.core.mvc"        xmlns="sap.m">    <Shell id="xxAppShellID">         <NavContainer id="mainNC">            <Page>               <content>                    <Label text="Example Text"/>                    <NavContainer id="nc_previewContent">                         <Label text="No viewview yet"/>                    </NavContainer>               </content>             </Page>          </NavContainer>     </Shell></mvc:view>

 

./views/preview.view.xml:

<mvc:View        xmlns="sap.m"        >    <Panel>      <Label text="preview Content goes here"/>    </Panel></mvc:View>

 

 

./routes.js:

var myRoutesDefaultSettings = {    viewType: sap.ui.core.mvc.ViewType.XML,    clearTarget: false
};
var myroutes = [    {        name: "main",        pattern: "",        view: "xx.views.appRoot",        targetControl: "xxAppShellID",        targetAggreation: "content"    },    {        name: "preview",        pattern: "preview",        view: "xx.views.preview",        targetAggreation: "nc_previewContent"    }
];

Viewing all articles
Browse latest Browse all 2806

Trending Articles



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