Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Pass Parameter Master to Detail Page

$
0
0

Hi Expert,

 

I want to pass parameter master page to detail page.

 

I use this code bu there is an error I couldn't find,

 

master.controller.js

 

 

handleListItemPress : function (evt) {

       

      imp =  evt.getSource().getTitle();

 

var oRouter = sap.ui.core.UIComponent.getRouterFor(this);

    oRouter.navTo("Detail", imp);

}

 

detail.controller.js

 

onBeforeRendering:function (){

this.router.attachRouteMatched(function(oEvent) {

                     if (oEvent.getParameter("name") !== "Detail") {

                         return;

                             }

               

                         imp = oEvent.getParameter("arguments").imp;

      },
  
     this);
  
   },

 

 

component.js

 

metadata : {

    

    routing: {
        config: { // default values for routing
            viewType : "XML",
            viewPath: "sap.ui.demo.myFiori.view.Master",
            clearTarget: false
        },
        routes: { // contains routing configuration objects
            "myRouteName" : {
                name :"myrouter" ,
                pattern : "Detail",
                view : "myViewId"
            }
        }
    }

     

    }

 

 

Where is my wrong ?

 

thnks..


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>