Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
lou cat
[SOLVED] message BEFORE logout
20 de Junho de 2012 02:52
Resposta

lou cat

Ranking: Regular Member

Mensagens: 151

Data de entrada: 26 de Janeiro de 2012

Mensagens recentes

Hi there!

I'd need to have a message (a pop-up window would be a good option, but not the only one) that asks the user if he really wants to logout, before actually logging out.
I've added a logout link in my side-navigation but I don't want that clicking in that page the user logs out directly.

Is there a quick way to do it? Is it something I can do editing a velocity template, a portal property, or adding an out-of-the-box portlet?

Thanks for any suggestion!
R V
RE: message BEFORE logout
22 de Maio de 2012 08:22
Resposta

R V

Ranking: New Member

Mensagens: 18

Data de entrada: 11 de Janeiro de 2012

Mensagens recentes

creating a hook for the jsp that has the logout action and having a confirm javascript dialog would be the way to go.
lou cat
RE: message BEFORE logout
23 de Maio de 2012 01:18
Resposta

lou cat

Ranking: Regular Member

Mensagens: 151

Data de entrada: 26 de Janeiro de 2012

Mensagens recentes

Thanks RV!

but what if I wanted the logout action to have a confirmation message when you click it on the side-navigation, and to act directly as usual when clicking in the dock of the portal?
Should I create 2 different logout actions?
lou cat
RE: message BEFORE logout
15 de Junho de 2012 01:46
Resposta

lou cat

Ranking: Regular Member

Mensagens: 151

Data de entrada: 26 de Janeiro de 2012

Mensagens recentes

Could I have more information on this, please?
I've tried to figure out how to do it but I'm still pretty new to hooks and similar...
It seems to me a normal need so I'm surprised there is no configuration file or something more easy to do in order to have a confirmation message instead of logging out directly emoticon

So, let's suppose I want to change the behaviour of every log out link... should I create a custom log out pre-action in order to show the pop up dialog box?
And is Javascript the only method I can use?
I know how to create a hook of an action but I don't know if I should call the dialog box inside its run method, calling a JSP or what... I'm pretty clueless at the moment and I haven't found much info on the web.

thanks!
Ali Shahrami
RE: message BEFORE logout
15 de Junho de 2012 11:16
Resposta

Ali Shahrami

Ranking: Junior Member

Mensagens: 52

Data de entrada: 31 de Julho de 2009

Mensagens recentes

Lou,

I'm not sure how you have added logout link to your side-navigation. See if this help:

- replace the logout href with "javascrip:void(0); Add a unique id to <a> tag
- use your favorite javascript api, ie jQuery to open a confirmation popup upon clicking on logout link. This script can be added to the theme.
- add the actual logout link to the confirm button.

Ali
lou cat
RE: message BEFORE logout
18 de Junho de 2012 02:20
Resposta

lou cat

Ranking: Regular Member

Mensagens: 151

Data de entrada: 26 de Janeiro de 2012

Mensagens recentes

Thank you very much Ali, now I got the ideas clearer emoticon
lou cat
RE: message BEFORE logout
20 de Junho de 2012 02:51
Resposta

lou cat

Ranking: Regular Member

Mensagens: 151

Data de entrada: 26 de Janeiro de 2012

Mensagens recentes

I used JQuery confirm() function linked to a tag with the normal $sign_out_url (instead of a href="javascript: void(0)"), and it works emoticon Thanks!