Page 1 of 1

Multi-page and service invocation from js

Posted: Tue Apr 23, 2013 9:20 am
by dale

Hi,

Based on the fact that I writing a small app (3 pages), want faster page loads and know the capabilities of my target platform, I think I've decided to re-write things for a multi-page template.

At the moment, I using onloads on pages to fire functions, though with multipage there's only one call at the start of the app, so I'll need to work things differently.

So I'm thinking, click button, show page (via js) and run service (via js).

I think I read somewhere that a service instance has to be present on a page, in order to be invoked from Javascript, but is this true for multi-page and would the above sequence actually work as the service is invoked after another page is shown?

Thanks,

Dale.


Multi-page and service invocation from js

Posted: Tue Apr 23, 2013 12:35 pm
by Maryna Brodina

Hello!

1) Use page Show event instead of Load;
2) if you add service to each page it won't affect app loading speed.


Multi-page and service invocation from js

Posted: Tue Apr 23, 2013 1:25 pm
by dale

Thanks, do I need to add a service to each page?
Dale.


Multi-page and service invocation from js

Posted: Tue Apr 23, 2013 1:35 pm
by Maryna Brodina

Yes


Multi-page and service invocation from js

Posted: Tue Apr 23, 2013 6:26 pm
by dale

Thanks.


Multi-page and service invocation from js

Posted: Tue Apr 23, 2013 6:31 pm
by dale

R.e. "Use page Show event instead of Load"

I don't have "Show" listed in "Common Events" for the 'landing' page.
I thought you meant use this event to then run the service?

Maybe I'm missing something obvious? Sorry.

Thanks,

Dale.


Multi-page and service invocation from js

Posted: Tue Apr 23, 2013 7:07 pm
by Kateryna Grynko

Dale,

I meant "Page Show" event. It is on each page.


Multi-page and service invocation from js

Posted: Tue Apr 23, 2013 7:43 pm
by dale

I'm sorry, my fault entirely, I just looked at the list alphabetically ... yes, found it now. Thanks. I'll give it a try.