Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
pawan chauhan
Removing custom "Your request processed successfully" message
31 dicembre 2012 4.32
Risposta

pawan chauhan

Punteggio: Junior Member

Messaggi: 75

Data di Iscrizione: 8 ottobre 2012

Messaggi recenti

Hi all,

I am trying to remove the "Your request processed successfully" message that shows up every time an action is performed.
I have come across two ways.

1>One suggestion is to remove it from entire portlet.(by making an entry in portlet.xml)
2>The other one is where We can replace the message by our own custom message in the desired action.

But what i am trying to do is remove the custom message from the action i want and have it only in few actions.
Is it possible,
Please Advise (I am using liferay 6.1)

Regards,
Pawan Chauhan.
Jitendra Rajput
RE: Removing custom "Your request processed successfully" message
31 dicembre 2012 5.03
Risposta

Jitendra Rajput

Punteggio: Liferay Master

Messaggi: 756

Data di Iscrizione: 7 gennaio 2011

Messaggi recenti

You can disable it for entire portlet via portlet.xml. And as you said for few action you want to display success message then simply you can write few lines code at the end of action.

 1
 2
 3protected void addSuccessMessage(
 4        ActionRequest actionRequest, ActionResponse actionResponse) {
 5
 6        String successMessage = ParamUtil.getString(
 7            actionRequest, "successMessage");
 8
 9        SessionMessages.add(actionRequest, "request_processed", successMessage);
10    }
Hitoshi Ozawa
RE: Removing custom "Your request processed successfully" message
31 dicembre 2012 7.09
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7954

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

In the action you want to remove, just override the addSuccessMessage method.

Refer to Amos' reply:
http://www.liferay.com/community/forums/-/message_boards/message/5872211
pawan chauhan
RE: Removing custom "Your request processed successfully" message
1 gennaio 2013 4.41
Risposta

pawan chauhan

Punteggio: Junior Member

Messaggi: 75

Data di Iscrizione: 8 ottobre 2012

Messaggi recenti

Hi Jitendra,
Thanks for the reply.

I would like to ask if both the things have to be done.
I mean make an entry in portlet.xml and then write the code snippet or just write the code snippet .
And can u please explain a little more about the code, where to write it and where do i define which actins to work on.

Regards,
Pawan Chauhan.
Tanaji Londhe
RE: Removing custom "Your request processed successfully" message
1 gennaio 2013 23.58
Risposta

Tanaji Londhe

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 25 aprile 2012

Messaggi recenti

Hi Pawan,

If u want remove Success Message at all in your portlet . Make this entry for particular portlet in portlet.xml file after <portlet-class> and before <expiration-cache>
<init-param>
<name>add-process-action-success-action</name>
<value>false</value>
</init-param>

Refer this below link u will get some basic idea, regarding how to add and remove Success Message from ur portlet.
http://www.liferay.com/community/wiki/-/wiki/Main/User+Feedback+-+Success+and+Error+Messages+in+Portlets
pawan chauhan
RE: Removing custom "Your request processed successfully" message
2 gennaio 2013 0.00
Risposta

pawan chauhan

Punteggio: Junior Member

Messaggi: 75

Data di Iscrizione: 8 ottobre 2012

Messaggi recenti

Hi Tanaji,
Thanks for the reply.
I have gone through the link..
At one point is says that adding this code snippet
1SessionMessages.add(actionRequest, (LiferayPortletConfig)portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_SUCCESS_MESSAGE);


will do the needful but it works only in liferay 6.2 n above .
I am using 6.1 but it want something exactly like this.
Any Ideas??

Regards,
Pawan Chauhan.
Tanaji Londhe
RE: Removing custom "Your request processed successfully" message
2 gennaio 2013 1.52
Risposta

Tanaji Londhe

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 25 aprile 2012

Messaggi recenti

I am also using 6.1 and its working properly for me.
using this code remove success message at all in your portlet.
<init-param>
<name>add-process-action-success-action</name>
<value>false</value>
</init-param>

Dont need to specify this code. This code is required when you want to remove success message on particular action.
SessionMessages.add(actionRequest, (LiferayPortletConfig)portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_SUCCESS_MESSAGE);
pawan chauhan
RE: Removing custom "Your request processed successfully" message
2 gennaio 2013 1.55
Risposta

pawan chauhan

Punteggio: Junior Member

Messaggi: 75

Data di Iscrizione: 8 ottobre 2012

Messaggi recenti

Thank you all,
I finally got it working emoticon