on 05-04-2017 2:56 PM
Getting maximum call stack size error on calling ajax post on login. Cant figure out exactly what is causing this issue. I cant seem to find any recursive function.
Here is my xmlview file
<mvc:View
controllerName="abc.controller.LoginController"
xmlns:mvc="sap.ui.core.mvc"
xmlns:u="sap.ui.unified"
xmlns:c="sap.ui.core"
xmlns:m="sap.m"
xmlns:l="sap.ui.layout"
xmlns:tnt="sap.tnt">
<m:Page
id="loginPage"
showHeader="false"
enableScrolling="false"
class="sapUiContentPadding">
<m:Panel width="30%">
<l:Grid>
<l:content>
<l:VerticalLayout>
<m:Label text="User Name" design="Bold"/>
<m:Input id="username"/>
</l:VerticalLayout>
<l:VerticalLayout>
<m:Label text="Password" design="Bold"/>
<m:Input id="password" type="Password" />
</l:VerticalLayout>
<l:VerticalLayout>
<m:Button id="loginBtn" text="Login" press="toTablePage" />
</l:VerticalLayout>
</l:content>
</l:Grid>
</m:Panel>
</m:Page>
</mvc:View>
My login controller js file is
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/ui/model/json/JSONModel",
"sap/m/MessageToast"
], function(Controller, JSONModel, MessageToast) {
"use strict";
return Controller.extend("abc.controller.LoginController", {
onInit: function(){
},
toTablePage: function(){
var userName = this.byId("username");
var password = this.byId("password");
if(userName.getValue()!== "" && password.getValue()!== ""){
var aData = jQuery.ajax({
type: "POST",
contentType: "application/json",
url: "http://localhost:3000/api/logins",
dataType: "json",
data: jQuery.param({ email: userName, password : password}) ,
success: function (data, textStatus, jqXHR) {
alert(textStatus);
}
});
}
else
MessageToast.show("the username or password is wrong");
}
});
});
show error screenshot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.