Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

SAPUI5 application's controller not working as per required.

$
0
0

I have made an SAPUI5 application. It comprises of 2 page . On page1 the user enters the details which are send to Odata layer . then on page2 the user enter's  the random code which would go for validation after successful validation on the backend side the user's state would be verified whether the user is locked by admin or account is locked due to multiple incorrect passwords . SO to check the user' status the logic is written in controller but that logic does not work( No alerts appear or nothing is showed )which is as shown below:-

 

 

 

 

oModel.read("http://hillsaps02bt.global.enterprise:8000/sap/opu/odata/sap/Z_PASSWORD_RESET_DEMO_SRV_SRV/z_es_pwd_reset_rcode?$filter=Rcode eq '"+ rcode +"' and Chkbox eq '"+ chkbox +"' and Username eq '"+ Username +"' and Systemid eq '"+ Systemid +"' and Clientno eq '"+ Clientno +"'", null, null,true,fsuccess,ffailure);

  function fsuccess(event)

  {

       alert("Inside success!!");

       

     oModel.read("http://hillsaps02bt.global.enterprise:8000/sap/opu/odata/sap/Z_PASSWORD_RESET_DEMO_SRV_SRV/z_es_pwd_reset_user_state",      null, null, true, fsuccess, ffailure);

       function fsuccess(event)

       {

            alert("Inside another success2..");

            var modelresult = oModel(event.results);

            var user_state = modelresult.getProperty("/0/Userstate");

 

                 if(chkbox == "CB_UNLOCK")

{

     if(user_state== 0)

       {

            alert("User account is already active. No action taken.");

       }

       else if(user_state==1)

       {

            //if user account has been unlocked

            alert("User account is activated successfully..");

       }

       else if (user_state==2)

       {

       //if account is locked by the local or global administrator

       alert("User account cannot be unlocked. Kindly contact your system administrator.");

       }

       else

       {

       //User state undefined in any situation

       alert("Error occurred while activating the account");

       }

    }

else if(chkbox == "CB_PWDRESET")

  {

  if(user_state== 0)

  {

  alert("Password changed successfully.");

  }

  else if(user_state==1)

  {

  alert("Password changed successfully.");

  }

  else if (user_state==2)

  {

  alert("Password cannot be changed because it is locked by system administrator");

  }

  else

  {

  alert("Error occurred while changing the password");

  }

  }

function ffailure(event)

  {

  alert("User state not known..");

  }

  }


Viewing all articles
Browse latest Browse all 3523

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>