Disable default error and sucess message in liferay portlet.

Follow the below step to disable default error and success message in liferay portlet:

Step 1: Add the below code in portlet.xml

<init-param>
            <name>add-process-action-success-action</name>
            <value>false</value>
</init-param>
Before
<expiration-cache>0</expiration-cache>

Step 2: Add the below code in portlet action method

PortletConfig portletConfig = (PortletConfig)actionRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
            LiferayPortletConfig liferayPortletConfig = (LiferayPortletConfig) portletConfig;
            SessionMessages.add(actionRequest, liferayPortletConfig.getPortletId() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
            SessionMessages.add(actionRequest, liferayPortletConfig.getPortletId() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_SUCCESS_MESSAGE);

Comments

Popular posts from this blog

How to find the companyId in Liferay.

How to add portlet in liferay theme.

How to create soap client for ofbiz service or ofbiz service invocation from another application.