Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3165

when i'm using router, I have Error ("Can't read property 'navTo' of undefined )

$
0
0

I want to move page when i succeed to check login information. However it didn't work

 

below is my code.

 

oModel.read("/LOGIN_INFOSet(USRID='"+USRID+"',PASWD='"+PASWD+"')",null,null,false,

 

function(oData,repsonse){

  oJsonModel.setData(oData);

 

  sap.ui.core.UIComponent.getRouterFor(this).navTo("Master" ,{

  currentView : this.getView()

  }, true);

 

  },

 

  function(oError){

  alert("Invalid Login Info. Please Check User ID and Password")

 

  }

  );

 

When i tried navTo code outside of function, it work.. see below

 

oModel.read("/LOGIN_INFOSet(USRID='"+USRID+"',PASWD='"+PASWD+"')",null,null,false,

  function(oData,repsonse){

  oJsonModel.setData(oData);

 

  },

 

  function(oError){

  alert("Invalid Login Info. Please Check User ID and Password")

 

  }

  );

 

sap.ui.core.UIComponent.getRouterFor(this).navTo("Master" ,{

  currentView : this.getView()

  }, true);

 

 

 

I want to use navigation code inside of success function. DO you guys have any Idea


Viewing all articles
Browse latest Browse all 3165

Trending Articles



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