Skip to Content

SAPUI5 Routing with multiple values

Dec 07, 2017 at 12:19 PM


avatar image

Hi all,

I have a data source where entries are identified not by a single key attribute but by a (possibly) large number of attributes. The data is available in OData format. I want to display that data in the "SAP Fiori Worklist Application". However, navigating to a detail view doesn't work, because I don't know how to pass multiple values from the worklist-controller to the detail-controller. All samples and tutorials I found only work with one value.

Here are some code snippets:

This is from the worklist-controller. I want to pass these two values to identify the entry and navigate to the corresponding detail page.

_showObject: function(oItem) {

    var oCtx = oItem.getBindingContext();

    this.getRouter().navTo("object", {
        G_DEVICE: oCtx.getProperty("G_DEVICE"),
        G_CREATED: oCtx.getProperty("G_CREATED")

In the detail-controller, I'm retrieving the values and binding the view

_onObjectMatched : function (oEvent) {
    var args = oEvent.getParameter("arguments");
    var device = args.G_DEVICE;
    var created = args.G_CREATED;
    this.getModel().metadataLoaded().then( function() {
      var sObjectPath = this.getModel().createKey("T_IOT_DA496D4F2BBE1E39BF4F", {
         G_DEVICE : device,
         G_CREATED : created
       this._bindView("/" + sObjectPath);

However, I do not know how to modify the manifest.json accordingly. Right now, it is as following which is obviously wrong.

  "pattern": "T_IOT_DA496D4F2BBE1E39BF4F/{G_DEVICE}",
  "name": "object",
  "target": ["object"]

How can I modify the pattern accordingly? It should also work for more than two variables.

Thank you very much for responding!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Jhon Jairo Teran Salazar Dec 07, 2017 at 12:45 PM

Hello Ulrich,

I don't know if this could help you but in one app that I made this was the way to do this in manifest.json file:

   "pattern": "DetScale_S3/{MillTypeId},{PorcMaxEst}",
   "name": "DetScale_S3",
   "target": ["DetScale_S3"]

Hope this could be what you're looking for.

Jhon Jairo.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hello Jhon Jairo

it's so easy! Thank you very much!