Skip to Content
author's profile photo Former Member
Former Member

splitapp using component.js in sapui5- detail, master view issue

0down votefavorite

I want to use component.js in sapui5 for routing in view in split app.But by using below code only master page is visible and detail page is not coming.I want both simultaneously on the screen



jQuery.sap.declare("com.bharthiyaApp.Component");

sap.ui.core.UIComponent.extend("com.bharthiyaApp.Component",{
metadata : {
rootView : "com.bharthiyaApp.bharathiya.App",
routing : {
config : {
viewType:"JS",
viewPath:"bharathiya",
targetControl:"splitApp",
targetAggregation:"pages",
clearTarget : false
},
routes : [
{
pattern : "",
name:"mainMenuPage",
view:"mainMenuPage",// This is the target view, to where navigation happens
targetAggregation:"masterPages",

},
{
pattern : ["homePage","homePage"],
name : "homePage",
view : "homePage",
targetAggregation:"detailPages",
targetControl:"splitApp"

}
],
}}
});

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Sep 15, 2016 at 09:49 AM

    Hi Priyanka,


    Try this:


    routes : [
    {

    pattern : "",
    name:"mainMenuPage",
    view:"mainMenuPage",
    targetAggregation:"masterPages",

    subroutes: [

    {

    pattern: "",

    name : "homePage",
    view : "homePage",
    targetAggregation:"detailPages"

    }

    ]

    }

    ]



    Best Regards,

    Amit

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 16, 2016 at 11:41 AM

    Hello Priyanka,

    Or just you can try this.

    routing: {

    config: {

    viewType: "JS",

    viewPath: "com.bharthiyaApp.bharathiya", //or com.bharthiyaApp.bharathiya.view, up to folder name of views

    targetAggregation: "detailPages",

    clearTarget: false

    },

    routes: [{

    pattern: "",

    name: "main",

    view: "mainMenuPage",

    targetAggregation: "masterPages",

    targetControl: "idAppControl", // id of split App

    subroutes: [{

    pattern: "", //or can be pass some binding path(enity path)/item id as {entity} or {objectId}

    name: "detail",

    view: "homePage"

    }]

    }]

    }

    Regards,

    Akhilesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.