Fórum

Default success and error message

Beppo Ivel, modificado 9 Anos atrás.

Default success and error message

Regular Member Postagens: 112 Data de Entrada: 09/04/14 Postagens Recentes
Hi.

By default, Liferay always displays a default success or error message when an action was executed. In my custom portlet I can add, update or delete a record in a DDL. After adding a record I get a success message. Next if I want to update or delete a record of this DDL it displays the success message and the default error message. If I would reload the site after adding a record the success message is gone. And then if I update or delete a record I get also a success message.

Till now I disable the default messaging for the portlet but I like to know where this behavior comes from.
thumbnail
Hitesh Methani, modificado 9 Anos atrás.

RE: Default success and error message

Regular Member Postagens: 171 Data de Entrada: 24/06/10 Postagens Recentes
Hello Beppo,

It comes from LiferayPortlet.java, under package com.liferay.portal.kernel.portlet,
Liferay gets the boolean member variable from
addProcessActionSuccessMessage = GetterUtil.getBoolean(getInitParameter("add-process-action-success-action"), true);

Hope this helps.
Thanks,
Hitesh Methani.
Beppo Ivel, modificado 9 Anos atrás.

RE: Default success and error message

Regular Member Postagens: 112 Data de Entrada: 09/04/14 Postagens Recentes
I read out that I could disalbe the msg for certain action via:

SessionMessages.add(actionRequest, (LiferayPortletConfig)portletConfig.getPortletName() + SessionMessages. KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);


But I dont understand why I get the error msg, because the portlet runs well on all action (add, delete, update).
thumbnail
Jitendra Rajput, modificado 9 Anos atrás.

RE: Default success and error message

Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
Are you getting error messages in UI even though every thing is working fine ? Could you please check error logs ?
Is this your custom portlet ? If so then post implementation details , Process action code etc.
Beppo Ivel, modificado 9 Anos atrás.

RE: Default success and error message

Regular Member Postagens: 112 Data de Entrada: 09/04/14 Postagens Recentes
It is a custom portlet, for example I attached a portlet-plugin-project with that behavior. To run it you need a DDL with the Field "Title" and copy the ID of the DDL and replace the recordSetId in the view.jsp:

long recordSetId=19355;
thumbnail
Jitendra Rajput, modificado 9 Anos atrás.

RE: Default success and error message

Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
Success Messages you can control by setting add-process-action-success-action to false in portlet.xml

<init-param>
<name>add-process-action-success-action</name>  
<value>false</value>
</init-param>