Page 3 of 5

Previous Successful JS Code worked, now no more to change popup on success of service request

Posted: Tue Jun 11, 2013 11:49 pm
by John Herdean

my project is also public at:

http://appery.io/app/mobile-frame?src...

OR I also you guys can access my project since i shared it. To get to the page:

Driver Login My Profile:

an input of '248-222-5555' will return a '1' and any other digits/characters will return always exactly '-1'

when a '-1' is returned, the next popup should be 'profile_not_saved'


Previous Successful JS Code worked, now no more to change popup on success of service request

Posted: Wed Jun 12, 2013 12:37 am
by Igor

Try to change code to next one:
code
if(data == -1 ) {
$.mobile.changePage("profile_not_saved.html", {transition: "pop"});
}
else {
$.mobile.changePage("profile_saved.html", {transition: "pop"});
}
/code


Previous Successful JS Code worked, now no more to change popup on success of service request

Posted: Wed Jun 12, 2013 9:09 am
by John Herdean

that line does the trick, thanks Igor


Previous Successful JS Code worked, now no more to change popup on success of service request

Posted: Wed Jun 12, 2013 3:39 pm
by John Herdean

hi, now going back to the original style code I started with that worked fine for a string response ( a 'true' or 'false') :

if(data.response==="true") {
$.mobile.changePage("status_updated.html", {transition: "pop"});
}
else {
$.mobile.changePage("status_not_updated.html", {transition: "pop"});
}

this code a couple weeks ago worked, now it doesn't work. Is there something that changed thats works with Appery? If so, what is the correct line of code now?


Previous Successful JS Code worked, now no more to change popup on success of service request

Posted: Wed Jun 12, 2013 3:42 pm
by Maryna Brodina

Hello! We didn't change anything. Do you have any errors in Console when you run this code?


Previous Successful JS Code worked, now no more to change popup on success of service request

Posted: Wed Jun 12, 2013 3:47 pm
by John Herdean

no errors:

Image


Previous Successful JS Code worked, now no more to change popup on success of service request

Posted: Wed Jun 12, 2013 3:48 pm
by John Herdean

it keeps going to the else line and doesnt see the 1st line and filter the result based on 'true' or not...


Previous Successful JS Code worked, now no more to change popup on success of service request

Posted: Wed Jun 12, 2013 4:18 pm
by John Herdean

now I went back to my original service i started with back a few weeks ago. It worked with the 'submit_load2' service with this exact code:

if(data.response==="true") {
$.mobile.changePage("load_submitted.html", {transition: "pop"});
}
else {
$.mobile.changePage("load_not_submitted.html", {transition: "pop"});
}

I just tested this service now and this has some issues as well. With this service, it has the opposite effect as the previous one. Instead of going to the 'true' line, it always goes to the 'else...' line no matter what the response is. So, we have two identical services with the same responses using the same exact JS, but getting two opposite results. This is strange...

Any ideas how to fix these services?


Previous Successful JS Code worked, now no more to change popup on success of service request

Posted: Wed Jun 12, 2013 4:49 pm
by John Herdean

i shared my Truck Project with you guys just in case you would like to check it out or go to the public test:

http://appery.io/app/mobile-frame?src...

for service 'UpdateStatus2' go to:
1 - Driver Login My Profile:
1a - type in 'xx', and hit 'Save'
1b - hit 'OK' (this will leave the driver_id' = '-1' (which should make an error in the next stage)
2 - Driver Login Update Status:
2a - Hit 'Update Status' at the bottom of the page: If the JS Code works in this case you should see the error popup: 'status_not_updated', but it keeps going to the 'status_updated' popup

for service 'submit_load2' go to:
1 - Dispatch Login Login Assign a New Load:
1a - go to the bottom of the page and hit 'Submit Load': If the JS code works in this case you should see the Submitted popup: 'load_submitted', but it keeps going to the error popup: 'load_not_submitted'
--


Previous Successful JS Code worked, now no more to change popup on success of service request

Posted: Wed Jun 12, 2013 4:51 pm
by John Herdean

and of course I tested both of these services work fine in the raw tests - just in case you were wondering