Hello,
On login page as shown below, if there are any errors from the service call, I return to the same page and display errors.
It works as expected, but the header part is gone missing when the login page is re-displayed with errors.
Using app.navigate to change the display based on success/failure scenarios.
Thanks for your time and help.
--
Hiren
<!DOCTYPE html>
<html>
<head>
<title>My App</title>
<link href="../resources/css/kendo.mobile.all.min.css" rel="stylesheet" />
<script src="../resources/js/jquery.min.js"></script>
<script src="../resources/js/kendo.all.min.js"></script>
</head>
<body>
<div id="home" data-role="view" data-layout="default">
<h4>Sign in</h4>
<p>Username or email</p>
<p><input id="username" type="text" /></p>
<p>Password</p>
<p><input id="password" type="password" /></p>
<p/>
<a href="kendoUI.html">Forgot your username or password</a>
<p/>
<a data-role="button" data-click="login">Login</a>
<div id="errors"></div>
</div>
<section data-role="layout" data-id="default">
<header data-role="header">
<div data-role="navbar">My App</div>
</header>
<footer data-role="footer">
<div data-role="tabstrip">
<a href="#home">Continue As Guest</a>
</div>
</footer>
</section>
<script>
var app = new kendo.mobile.Application(document.body,
{
transition:'slide'
});
function login(){
var username = $("#username").val();
var password = $("#password").val();
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "http://localhost:8080/MyApp/rest/SecurityService",
type: "POST",
dataType: "json",
data: { username: username, password : password }
}
},
requestEnd: function(e) {
console.log("requestEnd");
// console.log(e);
var response = e.response;
console.log(response);
var type = e.type;
if (type === "read"){
console.log("USERID : "+response.userId);
app.navigate("homepanel.html");
}else {
console.log("error");
$("#errors").html("User Not Found");
app.navigate("#home");
}
}
});
dataSource.read();
}
</script>
</body>
</html>
On login page as shown below, if there are any errors from the service call, I return to the same page and display errors.
It works as expected, but the header part is gone missing when the login page is re-displayed with errors.
Using app.navigate to change the display based on success/failure scenarios.
Thanks for your time and help.
--
Hiren
<!DOCTYPE html>
<html>
<head>
<title>My App</title>
<link href="../resources/css/kendo.mobile.all.min.css" rel="stylesheet" />
<script src="../resources/js/jquery.min.js"></script>
<script src="../resources/js/kendo.all.min.js"></script>
</head>
<body>
<div id="home" data-role="view" data-layout="default">
<h4>Sign in</h4>
<p>Username or email</p>
<p><input id="username" type="text" /></p>
<p>Password</p>
<p><input id="password" type="password" /></p>
<p/>
<a href="kendoUI.html">Forgot your username or password</a>
<p/>
<a data-role="button" data-click="login">Login</a>
<div id="errors"></div>
</div>
<section data-role="layout" data-id="default">
<header data-role="header">
<div data-role="navbar">My App</div>
</header>
<footer data-role="footer">
<div data-role="tabstrip">
<a href="#home">Continue As Guest</a>
</div>
</footer>
</section>
<script>
var app = new kendo.mobile.Application(document.body,
{
transition:'slide'
});
function login(){
var username = $("#username").val();
var password = $("#password").val();
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "http://localhost:8080/MyApp/rest/SecurityService",
type: "POST",
dataType: "json",
data: { username: username, password : password }
}
},
requestEnd: function(e) {
console.log("requestEnd");
// console.log(e);
var response = e.response;
console.log(response);
var type = e.type;
if (type === "read"){
console.log("USERID : "+response.userId);
app.navigate("homepanel.html");
}else {
console.log("error");
$("#errors").html("User Not Found");
app.navigate("#home");
}
}
});
dataSource.read();
}
</script>
</body>
</html>