/scripts/ahub.form.attachments.js
0

Getting maximum call stack size exceeded error on using ajax post

May 04, 2017 at 01:56 PM

149

avatar image

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");
            }
    });
    });
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jun Wu May 04, 2017 at 02:01 PM
0

show error screenshot

Share
10 |10000 characters needed characters left characters exceeded
Skip to Content