Robert Larsen
Posts: 0
Joined: Fri Aug 02, 2013 6:56 am

Prevent Navigation On Fail Of Service Call

I am using a Login a little different than the tutorial. I call a rest service and input an email and password for the request to the API. And if succesful I recieve data back. But If not then I receive an error response from the rest service. But my app continues to navigate to page on success of service. I have added a screenshot below of the return error when not including email or password, and another of when I do succesfully call the service. But what I have noticed is that in the debug console it shows that I have still succesfully called the API service, even when not having submitted the email or password, Screenshot below. What can I do to prevent page navigation on rest error? I have tried the java in other forums on the service error event. Image Imageinline.png?1465704870[/img] [/url] Image

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Prevent Navigation On Fail Of Service Call

Hello,

Please chech the response fore navigation to another screen, e.g.:

add JS below to the success event of that service:
preif(data && data.result){
Apperyio.navigateTo("secondPage");
}/pre
here secondPage - name of the page which should be opened on the success login

Robert Larsen
Posts: 0
Joined: Fri Aug 02, 2013 6:56 am

Prevent Navigation On Fail Of Service Call

Thank You! This seems to work great!

Return to “Issues”