andi
Posts: 0
Joined: Sat May 25, 2013 9:32 am

Is there somewhere an event OnApplication load?

I need an event where i can init some local vars.
The problem is that ihave a startpage, and this startpage has to know if it is first timeexecuted or not.
Because the other pages, are going back to this startpage.

But everytime all events are called (OnPageLoad, OnDeviceReady)
Is there an event which is executed only once?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Is there somewhere an event OnApplication load?

Hello! Sorry for late reply. There is no such event. If you don't use full screen refresh while navigating between screens and do not go to any external sites - then Load event for main page would work only one time. If Load event works a few times - looks like you have something from listed above. In this case you would need to change app logic. For example make in localStorage any flag variable and set it to true with other variables. Before you set other variables, check if you've already set flag:
codeif (localStorage.getItem('allSetted') != 'true'') {
//set you variables here
localStorage.setItem('allSetted', true);
}/code

andi
Posts: 0
Joined: Sat May 25, 2013 9:32 am

Is there somewhere an event OnApplication load?

Ahhhh yes now it works, it was because i used
Appery.navigateTo('Adressen');
instead of Appery.navigateTo('Adressen', {});

Return to “Issues”