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

How to Load view from another view button press event

How to load/display View from another View on Click of button press. I have 2 View from the below View need to load/display another view:

sap.ui.jsview("test.ViewInfo", {

/** Specifies the Controller belonging to this View.

* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.

* @memberOf test.ViewInfo

*/

getControllerName : function() {

return "test.ViewInfo";

},

/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.

* Since the Controller is given to this method, its event handlers can be attached right away.

* @memberOf test.ViewInfo

*/

createContent : function(oController) {

var btn = new sap.m.Button({

text:"test",

press:function(evt){

// Onclick of this button need to load/display another View

}

});

return new sap.m.Page({

title: "{products>name}",

showNavButton: true,

navButtonPress: function(){

window.history.go(-1);

},

footer:new sap.m.Bar({

contentLeft:[

btn

]

}),

content: [

]

});

}

});

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 13, 2016 at 12:31 PM

    Hi santosh,

    Try the below code

    app.to("pageid");

    or

    sap.ui.getCore().byId("app name").to(pageid);

    If this doesn't work please share your index.html and view code.

    Regards,

    Viswa

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 13, 2016 at 02:50 PM

    google ui5 navigation,

    or

    if you have App as your root element, it has navigation capability.

    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.