Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Renavigate back to page not working after filling dropdown

Hi, I have a strange issue in that when I navigate to a page and the pageload event runs the below code to fill a dropdown and then leave that page I am unable to navigate back to it? It just freezes the application.

The code on pageload is....

var detsarr=localStorage.getItem('horseDetails');
var obj = JSON.parse(detsarr);
var horseID=localStorage.getItem('currentHorseID');
var dropDown = Appery("selectInCompany");
dropDown.empty();
alert('empty');

for (var i=0; i < obj.length; i++) { // loop through the array
if (obj._id != horseID){
dropDown.append($('' +obj.name +''));
}

}

dropDown.selectmenu("refresh");
alert('refresh');

If I remove this code it I can renavigate back as normal.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Renavigate back to page not working after filling dropdown

Hi Aeneas,

It seems you have error in this code. So you make parse processing that could cause an error.

Please try to wrap this line of code into try catch:

precode

var detsarr = localStorage&#46;getItem('horseDetails');

try{
var obj = JSON&#46;parse(detsarr);
}
catch(e){
console&#46;log("error in parsing detsaar, use default empty array");
var obj = [];
};

var horseID = localStorage&#46;getItem('currentHorseID');
var dropDown = Appery("selectInCompany");

dropDown&#46;empty();

for (var i = 0; i < obj&#46;length; i++) { &#47;&#47; loop through the array
if (obj&#46;_id != horseID) {
&#47;&#47;This line of code is not correct(changed with get satisfation - you should use your one)
dropDown&#46;append($('<option>' + obj&#46;name + '</option>'));
}

};

dropDown&#46;selectmenu("refresh");

/code/pre

Regards.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Renavigate back to page not working after filling dropdown

This code makes no difference and there is no error being thrown in the catch. The actual drop down gets populated correctly but when I leave the page I cannot renavigate back to it after I run this code??

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Renavigate back to page not working after filling dropdown

Aeneas,

Problem probably in error on your page that prevent to load page.

Please give us your app public link and describe steps to reproduce this problem.

Regards.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Renavigate back to page not working after filling dropdown

No probs, how do I give you my public link?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Renavigate back to page not working after filling dropdown

Aeneas,

Here is screen shot about how you can get public link from your project:

http://prntscr.com/5et8eb/direct

Regards.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Renavigate back to page not working after filling dropdown

Great thanks. Public link is

http://appery.io/app/view/bea405ad-0a...

If you login as test/test and then choose 'Workouts" screen which will then run the code to populate the dropdown. The dropdown is shown by selecting the "In Company?" toggle button. If you then go back to previous screen and try going into Workouts again it doesn't work. Please ignore the alerts as I was using them for debugging purposes.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Renavigate back to page not working after filling dropdown

Hi Aeneas,

Can not find a way to choose 'Workouts" screen
Details: http://prntscr.com/5f5str/direct

Please make screen shot to clarify it.

Regards.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Renavigate back to page not working after filling dropdown

Hi, you need to login first from the startScreen first using test/test.

http://appery.io/app/view/bea405ad-0a...

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Renavigate back to page not working after filling dropdown

Hi Aeneas,

That's exactly what i do.

Login with test/test. http://prntscr.com/5ff4t9/direct
After login immediatelly i have this page: http://prntscr.com/5ff565/direct
Regards.

Return to “Issues”