This is a migrated thread and some comments may be shown as answers.

Loosing layout header on re-displaying the same page with errors

1 Answer 17 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Hiren
Top achievements
Rank 1
Hiren asked on 19 Jun 2014, 08:40 PM
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>

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 20 Jun 2014, 10:41 AM
Hi Hiren,

You have encountered a bug we have slipped in the service pack release. It has already been resolved in our internal builds. You may either upgrade to the latest internal build or just remove the navigate call in that particular scenario - it is not necessary. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Hiren
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or