cancel
Showing results for 
Search instead for 
Did you mean: 

Routing Examples?

Former Member
0 Kudos

hi,

I am trying to implement routing in a fiori like app,Could anyone suggest me by providing better examples on routing in splitapp, which consumes both json and odata.

I am following these documents

Step 3: Navigation and Routing - UI Development Toolkit for HTML5 (SAPUI5) - SAP Library

Please help me out, by providing better examples.

thanks,

Sanjo Thomas

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

json and odata are about model/data NOT routing.


do you have some specific question? A master-detail template from webide is a good strating point if you need an example

Former Member
0 Kudos

hi,

I am trying to implement routing in my application.After some research, I am now able to implement routing in simple apps, but I facing lot of trouble in implementing in my fiori like app that I am developing.Like I am still not clear how to provide serviceurl(odata) in the component.js, where I have defined the routing, or how to provide routes in a splitapp, etc.

So, I just want some examples, which would clear my doubts.

former_member185414
Active Contributor
0 Kudos

Hello,

The concepts are very neatly here.

I will explain them in brief here.

There are multiple levels at which you can set model in the SAPUI5 application. It can be set at Component Level, View Level, Control Level, etc. We usually keep all the configurations in a single consolidated file so that any change made at one place gets updated everywhere. Now if you want to provide service URL in component file you need to give the full path. An example of manifest.json is -

{

"_version": "1.1.0",

"sap.app": {

      "_version": "1.1.0",

      "id": "<id>",

      "type": "application", 

      "title": "App Name",

      "description": "App Desc",

      "applicationVersion": {

        "version": "1.0.0"

      },

      "ach": "CA-UI5-DOC"

  },

"sap.ui": {

      "_version": "1.1.0",

      "technology": "UI5",

      "deviceTypes": {

        "desktop": true,

        "tablet": true,

        "phone": true

      },

      "supportedThemes": [

        "sap_bluecrystal"

      ]

  },

"sap.ui5": {

      "_version": "1.1.0",

      "rootView": "<namespace>.view.App",

      "dependencies": {

        "minUI5Version": "Comment: Minimum version of SAPUI5 which is supported",

        "minUI5Version": "1.30",

        "libs": {

            "sap.m": {}

        }

      },

      "config": {

        "Detail": "<host:port>/sap/opu/odata/sap/<ServiceNam>/tileSummary/"

      },

      "routing": {

        "config": {

            "routerClass": "sap.m.routing.Router",

            "viewType": "XML",

            "viewPath": "<namepsace-viewpath>.view",

                "controlId": "app",

            "controlAggregation": "pages"

        },

"routes": "Comment: Routing Paths",

        "routes": [          

            {

              "pattern": "",

              "name": "summary",

              "target": "summary"

            }

        ],       

        "targets": {

        "summary" : {

        "viewName": "summary"

        }

      }

      }

  }

  }

Here I have mentioned the OData service URL in the manifest.json file under a config parameter with name 'Detail'. I will use the same to create OData Model and set it on any level as mentioned by me above. The 'targets' will define the routes.

Revert in case of further questions.

BR.

Former Member
0 Kudos

could you please help me out in this??

Answers (1)

Answers (1)

kedarT
Active Contributor
0 Kudos

Hi Sanjo,

Here is a tutorial on Routing - SAPUI5 SDK - Demo Kit

Hope this helps

Former Member
0 Kudos

Hi, could you suggest me some examples from jsbin or jsfiddle?any live examples?

kedarT
Active Contributor
0 Kudos

Look at these -