Page 1 of 2

intermittent appery db service results on page

Posted: Sat Sep 28, 2013 1:31 pm
by Sean Kelley

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


intermittent appery db service results on page

Posted: Sat Sep 28, 2013 2:40 pm
by maxkatz

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.


intermittent appery db service results on page

Posted: Sat Sep 28, 2013 5:15 pm
by Sean Kelley

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.


intermittent appery db service results on page

Posted: Sat Sep 28, 2013 8:10 pm
by maxkatz

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.


intermittent appery db service results on page

Posted: Sat Sep 28, 2013 9:14 pm
by Sean Kelley

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.


intermittent appery db service results on page

Posted: Sat Sep 28, 2013 9:40 pm
by maxkatz

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.


intermittent appery db service results on page

Posted: Sun Sep 29, 2013 10:24 am
by Sean Kelley

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.


intermittent appery db service results on page

Posted: Sun Sep 29, 2013 12:03 pm
by Alena Prykhodko

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


intermittent appery db service results on page

Posted: Sun Sep 29, 2013 12:34 pm
by Sean Kelley

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...


intermittent appery db service results on page

Posted: Sun Sep 29, 2013 4:37 pm
by maxkatz

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