cancel
Showing results for 
Search instead for 
Did you mean: 

Problem on navigating from one view to another in SAP UI5 application

Former Member
0 Kudos

Hello All,

As per my requirement I have created the split app using SAP UI5 controls in hcp. And in the detail side, I have the table which list the service tickets from there I would like to navigate to another view (Service detail - custom view created).

For this routing and navigation, I have set the routing infor and configurations in manifest.json as like below:

"routing": {

  "config": {

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

  "viewType": "XML",

  "viewPath": "SplitApp.view",

  "controlId": "idAppControl",

  "bypassed": {

  "target": []

  },

  "async": true

  },

  "routes": [

      {

  "pattern": "",

  "name": "splitapp",

  "controlAggregation": "detailPages",

  "target": "SplitApp"

  },

  {

  "pattern": "srvdetail/{ID}",

  "name": "srvdetail",

  "target": ["splitapp" , "srvdetail"]

  }

     ],

  "targets": {

     "splitapp": {

  "viewName": "SplitApp",

  "viewId": "SplitApp",

  "viewLevel": 1

  },

  "srvdetail": {

  "viewName": "SrvDetail",

  "viewId": "srvdetail",

  "viewLevel": 2

  },

  "objectNotFound": {

  "viewName": "ObjectNotFound",

  "viewId": "objectNotFound"

  },

  "notFound": {

  "viewName": "NotFound",

  "viewId": "notFound"

  }

  }

  }

Then in the controller of initial view, inside the onpress event, I have set the binding context and and the value selected got filled. But on exectuing last line its shows error as "The segment {ID} is required."

this._router = sap.ui.core.UIComponent.getRouterFor(this);

var oBindContext = oEvent.getSource().getBindingContext();

  var oModel = oBindContext.getModel();

   //  var oRouter = sap.ui.core.UIComponent.getRouterFor(this);

     var sObjectID = oModel.getData(oBindContext.getPath()).ID;

  this._router.navTo("srvdetail", {Id: sObjectID});

Please post your suggestions on this.

Regards

Swadini S

Accepted Solutions (1)

Accepted Solutions (1)

jibin_joy
Contributor
0 Kudos

Hi Swadini ,

It is Case sensitive . 

  this._router.navTo("srvdetail", {ID: sObjectID});



Regards,

Jibin Joy

Former Member
0 Kudos

Hi Jibin

Thanks for your reply.

I tested with that too, but still the same error. My view is "SrvDetail.view.xml". In this which are all case-sensitive kindly guide me on this.

Thank you

Regards

Swadini S

jibin_joy
Contributor
0 Kudos

Hi Swadini ,

Please share View , Controller and Component Files .

Regards,

Jibin Joy

Former Member
0 Kudos

Hi Jibin

Unable to attach the js files. So shall I share you through email, if so pls give your id.

Thank you!

Regards

Swadini

jibin_joy
Contributor
0 Kudos

Hi Swadihi ,

You can

Regards,

Jibin Joy

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi All,

Again am facing problem in navigation I have set new page for login and trying to navigate to second split app page in my sap ui5 application. On navigating what happens is, it prints the console and alerts in splitapp controller (target view's controller) but not displaying its corresponding splitapp view.

It was so weird, if it follows mvc , then how come the controller loads without showing the view.

If the problem is with displaying, then where am making mistake.

Please help me with the ideas of navigation as am being confused.

Thank you!

Regards

Swadini Sujanaranjan

agentry_src
Active Contributor
0 Kudos

Hi Swadini,

New question, new Discussion please! 

Since you already resolved the original question with the Case Sensitivity answer, a new Discussion should have a different subject and solution which can then benefit the entire community.

Regards, Mike (Moderator)

SAP Technology RIG