Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

intermittent appery db service results on page

I have been having a lot of trouble hiding and showing things on screen at the right times. I am starting to get confused with my three previously reported appery bugs and my lack of understanding on when to use events- ie. load vs show vs running a script in mapping to display results on page.

Case in point- I have service getting photos from appery database. I do not want the white nophoto image to display before service runs, so I decided to hide image on screen to start. When service is run I show photo in service script if value is not defined. Since doing this, photos and data show up sometimes and not others. If I click reload in browser, all loads okay.

I moved my code from on load event to have everything run on show to see if that helped. It did not. Now I am wondering if I am doing things in the right way or if I am experiencing bugs. For example, is the google map bug breaking the service which displays database results on page?

on page show for tackPage I run:
showTack.execute({data:{"object_id": query}});

on service mapping photo script looks like:
//value is photo link in appery db
if (value==undefined){
element.hide();
} else {
element.attr("src", value);
element.show();
}

Here are the relevant test pages:

http://appery.io/app/view/3208501b-d6...

secure versions which exhibits google errors:
https://app.nickershop.com/viewAds.html

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

intermittent appery db service results on page

Load event will only be invoked once when the page is loaded into the DOM. Show page event will be invoked each time the page is shown in the browser (even if already loaded into the DOM). Hope this helps.

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

intermittent appery db service results on page

So when is the right time to run a service- page load or page show? Are there any pro/cons to each?

Also, if you load a page, then another, then click back, does the service run again if run on page show event? Seems like it should. I find myself running a service to get fresh data or hide a screen component, then try to page reload to see changes:
Appery.navigateTo('viewAds', {reloadPage: true});

In my described case, images are supposed to be shown in mapping. This is not happening all the time. The same page will display correctly on one try then incorrectly on more attempts. I am trying to understand if appery is timing out or something else is going on. Why are my services not working all the time. They work- just not on each attempt- no errors.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

intermittent appery db service results on page

You can use either event, it entirely depends on what you are trying to do and your app logic.

Load event will only be invoked once. If you load a list (via load event), navigate to another page and go back, the even won't be fired any more. If you use show page event, then when you go back, the event will be fired.

Your app doesn't run in Appery.io (so Appery.io is not timing out). Your apps runs in the browser. When you test the app, it simply runs in the browser.

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

intermittent appery db service results on page

I have commented and factored down what I am doing. The problem seems to be related to a google map component on related page. I reported a bug regarding map component a while ago. I have shared my app with more description via email to see if the issue relates to the map bug.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

intermittent appery db service results on page

Do you mean on a different page? Does it work if you remove the map? It is strange that a Google Map component would cause a service not to be invoked sometimes.

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

intermittent appery db service results on page

the google map is on a different page. It works when I do not click on the map then click back to problem page or previous list. The list works fine, the page works fine...until you click on map button at bottom to go to map page.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

intermittent appery db service results on page

Hello! Please tell how to reach the issue during testing.
And on what page do you have map component?

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

intermittent appery db service results on page

this list:
http://appery.io/app/view/3208501b-d6...

takes you pages which break sometimes (no data loaded- no service run). Now that I am testing this morning, it is breaking before clicking map page. Yesterday I could not get it to break until map page was loaded.

mapPage is the name of map page- address is retrieved when set on map button click on a page such as:
http://appery.io/app/view/3208501b-d6...

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

intermittent appery db service results on page

Let's start with the first link.. when you go to the page the service sometimes runs and sometimes doesn't run?

Return to “Issues”