Skip to Content
0

Problem with Navigation using ORouter.

Jan 04 at 04:59 AM

28

avatar image
Former Member

i can navigate to details page.. but not to amar page.. please help me out guys...

.js

sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/m/MessageToast",
], function (Controller, MessageToast) {
"use strict";
return Controller.extend("sap.ui.demo.wt.controller.HelloPanel", {

        onPress1: function(){

        var a = document.getElementById("__xmlview2--name-inner").value;
        var b = document.getElementById("__xmlview2--pass-inner").value;
        var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
        if(a.match(mailformat))
        {
        var paswd=  /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{7,15}$/; 
        if(b.match(paswd)) 
        {
        alert("Login Successfull!")
        var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
    oRouter.navTo("amar"); 
        }
        }
        else
        {
        alert("Username and Password invalid!")
        }

},

        onPress2: function(){ 

},

        onPress3: function(){
        var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.navTo("detail");

},
});
});

manifest.json

{ 
   "_version":"1.1.0",
   "sap.app":{ 
      "_version":"1.1.0",
      "id":"sap.ui.demo.wt",
      "type":"application",
      "i18n":"i18n/i18n.properties",
      "title":"{{appTitle}}",
      "description":"{{appDescription}}",
      "applicationVersion":{ 
         "version":"1.0.0"
      },
      "dataSources":{ 
         "invoiceRemote":{ 
            "uri":"/destinations/northwind/V2/Northwind/Northwind.svc/",
            "type":"OData",
            "settings":{ 
               "odataVersion":"2.0"
            }
         }
      }
   },
   "sap.ui":{ 
      "_version":"1.1.0",
      "technology":"UI5",
      "deviceTypes":{ 
         "desktop":true,
         "tablet":true,
         "phone":true
      },
      "supportedThemes":[ 
         "sap_hcb",
         "sap_belize"
      ]
   },
   "sap.ui5":{ 
      "_version":"1.1.0",
      "rootView":"sap.ui.demo.wt.view.App",
      "dependencies":{ 
         "minUI5Version":"1.30",
         "libs":{ 
            "sap.m":{ 
            }
         }
      },
      "models":{ 
         "i18n":{ 
            "type":"sap.ui.model.resource.ResourceModel",
            "settings":{ 
               "bundleName":"sap.ui.demo.wt.i18n.i18n"
            }
         },
         "invoice":{ 
            "dataSource":"invoiceRemote"
         }
      },
      "resources":{ 
         "css":[ 
            { 
               "uri":"css/style.css"
            }
         ]
      },
      "routing":{ 
         "config":{ 
            "routerClass":"sap.m.routing.Router",
            "viewType":"XML",
            "viewPath":"sap.ui.demo.wt.view",
            "controlId":"app",
            "controlAggregation":"pages"
         },
         "routes":[ 
            { 
               "pattern":"",
               "name":"overview",
               "target":"overview"
            },
            { 
               "pattern":"amar",
               "name":"amar",
               "target":"amar"
            },
            { 
               "pattern":"detail",
               "name":"detail",
               "target":"detail"
            }
         ],
         "targets":{ 
            "overview":{ 
               "viewName":"Overview"
            },
            "amar":{ 
               "viewName":"Amar"
            },
            "detail":{ 
               "viewName":"Detail"
            }
         }
      }
   }
}
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers