Page 3 of 3

Logout custom component does not work

Posted: Tue Jul 07, 2015 7:27 pm
by Asif Ansari

So the first one shows the custom component. On logout click from the navbar, its set to invoke a service to log the user out. The 2nd screenshot shows the service inside of the component that is supposed to be triggered, its mapped to session token correctly and I have confirmed the session is available prior to logout. The 3rd screenshot shows the page where the component is used. Upon clicking the logout button from the page, it never invokes the service from the component. Do you need further clarification?


Logout custom component does not work

Posted: Tue Jul 07, 2015 8:53 pm
by Evgene Karachevtsev

Asif,

Please specify do you call the service on every page where you use this component or you just add it on a page?


Logout custom component does not work

Posted: Tue Jul 07, 2015 9:16 pm
by Asif Ansari

Every page has the component in the header. I was expecting to only call the service once from the component itself, so that all of the pages could inherit that functionality, but the service never gets invoked. The idea is that the service should be able to logout from any page using the same re-usable code.


Logout custom component does not work

Posted: Thu Jul 09, 2015 4:49 am
by Yurii Orishchuk

Hi Asif,

Some information:

1 You can invoke service datasource
2 Service datasource available only on page where it was defined.
3 You can not add datasource to the custom component.

So, in your case it will not be work.

If you want to implement common implementation with services - you need to use "page template" instead of custom component.

For this goal:
1 Create page template.
2 Put there needed components(nav bar, etc).
3 Put on this template page needed service datasource(logout).
4 Invoke this datasource from navbar button click.
5 Create page based on template(1 step).
6 Create other page based on template(1 step).
....

You can find more info about page template here: https://devcenter.appery.io/documenta...

Regards.