Skip to Content
avatar image
Former Member

How to pass data from one view to another view, using target for Navigation

Hi ,

I'm using the following code to navigate from one view to another.

How do i pass data using this and how to receive it in the next view

this.getRouter().getTargets().display("view2");
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 28, 2017 at 04:06 PM

    Hi,

    Please check the below reference code:

    View 1:

    this.getRouter().getTargets().display("targetName",{
    				param1 :"test1"});

    View 2 init code:

    oTarget = oRouter.getTarget("targetName");
    oTarget.attachDisplay(function(oEvent){
    
        var oPassedData = oEvent.getParameter("data"); // you will get data here
    
    },this);
    Add comment
    10|10000 characters needed characters exceeded