Skip to Content

How does SAPUI5 configures which xml view has to be displayed?

I'm a newbie to SAP HANA, so this may be a very dumb question, and I apologize for this.

I started creating a new "Quick Start with Layout Editor" project, run it as is, then tried to add a new View with a new Data Set.

I have not found any way to understand why running the project I get the View1.view.xml displayed.

The only possible solution is that there is some weird convention that forces a view named "View1.view.xml" to be displayed through a controller named "View1.controller.js".

So if my new view is named View2 I have not been able to derive how to get it displayed instead of "View1".

I have been able to display my new view only bay renaming it as "View1" (and now I'n not able anymore to diplay the old View1 that has been renamed as "View3" ...)

The script executed by "index.html" is the following

sap.ui.getCore().attachInit(function() { 
     new sap.m.Shell({
         app: new sap.ui.core.ComponentContainer({
                height : "100%",
                name : "QuickStartApplication"
         })
     }).placeAt("content");
});

Please help me understand where to configure View1 or View3 or whatever else as the starting point.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 03, 2016 at 06:43 PM

    Hi,

    in component.js file you can get routing property and its configurations. there you can get your view navigation property and all, something like below:

    routing: {
    // The default values for routes
    config: {
    "viewType": "XML",
    "viewPath": "",
    "targetControl": "",
    ..........
    },
    routes: [{}, {}]
    }

    in routes key you can change as appropriate view with desired view name.

    May this helps.

    Regards,

    Akhilesh

    Add comment
    10|10000 characters needed characters exceeded