Logout custom component does not work

This forum contains topics that were moved from Get Satisfaction
Asif Ansari
Posts: 0
Joined: Tue Jul 07, 2015 4:00 am

Logout custom component does not work

Post 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?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Logout custom component does not work

Post 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?

Asif Ansari
Posts: 0
Joined: Tue Jul 07, 2015 4:00 am

Logout custom component does not work

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Logout custom component does not work

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

Post Reply