Page 1 of 1

Adding new DB Sevice on existing template is not available/executing in child pages

Posted: Sun Sep 14, 2014 5:44 am
by Next Thing

Hi

I have an Page template in my app. If i do any UI related changes in the template then it gets reflected in all the pages but if I add a DB service to the template it does get added on the child pages.

IT IS A BUG!!

When I tried "Breaking Apart the template" on one of the pages or added a new page with the template then that page seems to work. However the existing pages still don't work.


Adding new DB Sevice on existing template is not available/executing in child pages

Posted: Sun Sep 14, 2014 6:05 am
by Alena Prykhodko

Hello,

This is how it works. Please find more here http://devcenter.appery.io/documentat...


Adding new DB Sevice on existing template is not available/executing in child pages

Posted: Sun Sep 14, 2014 6:17 am
by Next Thing

Hi Alena,

This is the generic document. Request you to go through my question again. When I am adding a new DB service on my Screen Template (this service should fire when the Panel, again on the template itself, opens). This newly added service is not available on child pages


Adding new DB Sevice on existing template is not available/executing in child pages

Posted: Sun Sep 14, 2014 7:15 am
by Alena Prykhodko

As I understand you add Service after page is created, these changes won't be applied.

[quote:]Note: You also cannot edit events and services added to the screen template on the page created from the template. They will not appear on the Events or Data tabs of your page, but they will still work. You also cannot add events to the components from the template.[/quote]


Adding new DB Sevice on existing template is not available/executing in child pages

Posted: Sun Sep 14, 2014 11:03 am
by Next Thing

So how can I add a new DB service now on the Panel.
I have a panel on the Page template and now I want to add a new DB service that gets invoked when the panel is opened from any page


Adding new DB Sevice on existing template is not available/executing in child pages

Posted: Mon Sep 15, 2014 1:28 am
by Yurii Orishchuk

Hi Next,

You can use following code to invoke your service(from template) on the page based on this template:

pre

//Note you need replace "templatePageService4" with datasource name from template data tab.
templatePageService4.execute()

/pre

Regards.


Adding new DB Sevice on existing template is not available/executing in child pages

Posted: Fri Oct 10, 2014 8:26 am
by Carlota

Yurii
From the description on this thread I think have similar problems.

In my app (http://appery.io/app/mobile-frame?src...) I have a template handling a panel menu. If I click specific option in this menu ("CumpleaƱos" in my example), I show a hidden text and two buttons. When clicking on Confirm button ("Siii!" in my example) a JS is executed, showing an alert and then executing a service called birthday_poll. Both The JS and the datasource-service mapping are defined at template level.
I Save and Test.
From any of the pages created from the Template, I open the panel menu (button on the top left corner), follow all the steps descripbed above and verify the behaviour in the console logs. What I see is
Uncaught ReferenceError: birthday_poll is not defined

How shall I proceed?
Shall I define the datasource-service mapping at template level before creating template-based pages?
Shall I define the datasource-service mapping at page level (I have several template-based pages)?

Thank you in advance!
Carlota F:


Adding new DB Sevice on existing template is not available/executing in child pages

Posted: Sun Oct 12, 2014 11:53 pm
by Yurii Orishchuk

Hi Carlota,

Did you edit(add service) template after create page from this template?

If so - please take a look here: http://devcenter.appery.io/documentat...

Details: http://prntscr.com/4vmiyj/direct

Regards.