Posts

Showing posts with the label Hiding

Hiding the Default Error message

Image
In the Liferay, when ever we get the exception by default  error message will be displayed. So how to remove that message as below? Just add the below code at the class level where your excepting the error can occur. Code as follows as SessionMessages.add(actionRequest, (LiferayPortletConfig)portletConfig.getPortletName() + SessionMessages. KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); Thats it , we have disabled the default error message. Anyhow we are discussing about the error message, here we will discuss how to create the error message, Creating the Error message in the Liferay . In Class : SessionErrors.add(actionRequest, "error-key"); In JSP: <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> <liferay-ui:error key="error-key">        <liferay-ui:message key="validation-perference-exception" /> </liferay-ui:error>

Hiding or Disabling the default sucess message

 By default in liferay, Whenever you submit form you will have default message as " Your request is proceed Successfully " How to disable it? There are 2 steps Step 1:    Just add below in portlet.xml before "excripation-cache" add-process-action-success-action false Step 2: Add the below code in the class level of a method SessionMessages.add(portletRequest,PortalUtil.getPortletId(portletRequest) +SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_SUCCESS_MESSAGE); For Reference look into the PortletAction class of hideDefaultSuccessMessage method