Skip to Content
avatar image
Former Member

view navaigation from detail1 to master2 splitapp

Hi,

Iam not able to navigate from split app master1-detail1 view to master2-detail2 split app view ,using routing.

please help me how to write the code in Component.js file using routing for the above scenario.

for example, i need to navigate from a split app with master1 and detail1 to another splitapp which is having

master2 and detail2 view ,when i click on detail1 view item data.

Regards,

Vamsi

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 10, 2015 at 05:01 PM

    i tried with the below code in Component.js file and it is navigating from resource1->master1->detail1

    but not navigating further from detail1 to master2 split app. please help.

    routes: [{

    pattern: "",

    name: "resource1",

    view: "resource1",

    targetControl: "pickContent"

    }, {

    pattern: "split",

    name: "app",

    view: "App",

    targetControl: "pickContent",

    subroutes: [{

    pattern: "{entity}",

    name: "master",

    view: "Master",

    targetAggregation: "masterPages",

    preservePageInSplitContainer: true,

    targetControl: "idAppControl",

    subroutes: [{

    pattern: "{entity}/:tab:",

    name: "detail",

    view: "Detail",

    targetAggregation: "detailPages",

    targetControl: "idAppControl",

    subroutes: [

    {

    pattern:"{entity}",// "master2",

    name: "master2",

    view: "Master2",

    //targetAggregation: "masterPages",

    //targetControl: "idAppControl",

    subroutes: [

    {

    pattern: "{entity}/:tab:",

    name: "detail2",

    view: "Detail2"

    //targetAggregation: "detailPages"

    }

    ]

    }

    ]

    }]

    }]

    },

    Message was edited by: vamshi krishna

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Krishna,

      you should read again the official documentation from SAP regarding routing since it seems that you haven't yet understood all principles i.e. you assign two times the pattern ""{entity}" for two different routes. This can't work. You can find the tutorial here : Step 3: Navigation and Routing - UI Development Toolkit for HTML5 (SAPUI5) - SAP Library

      The following code should give you an idea of how your Component.js metaconfig should look like:

      {

      "routes": [

      {

      title: "Master1",

      name: "Master1",

      view: "Master1",

      targetPage: "Master1",

      targetAggregation : "masterPages",

      viewType: "JS",

      viewLevel: 1,

      pattern : "Master1"

      subroutes: [

      {

      title: "Detail1",

      name: "Detail1",

      view: "Detail1",

      targetPage: "Detail1",

      targetAggregation : "detailPages",

      viewType: "JS",

      viewLevel: 2,

      pattern : "Master1/{Detail1id}"

      }

      },

      {

      title: "Master2",

      name: "Master2",

      view: "Master2",

      targetPage: "Master2",

      targetAggregation : "masterPages",

      viewType: "JS",

      viewLevel: 1,

      pattern : "Master2",

      subroutes: [

      {

      title: "Detail2",

      name: "Detail2",

      view: "Detail2",

      targetPage: "Detail2",

      targetAggregation : "detailPages",

      viewType: "JS",

      viewLevel: 2,

      pattern : "Master2/{Detail2id}"

      }

      ]

      }

      }

      Keep in my mind that you will have to assign handleRouteMatched to the router of your app in the init method of the involved controllers to use the infromation given by the router i.e. {detail2id} and bind it to the view.

      If this worked please let me know!