Whenever we make use of SessionErrors to display error message in Liferay, below default error message is also displayed by Liferay.
To get rid of this default message use the below code snippet -
NOTE: This will work for specific portlet only.
To get rid of this default message use the below code snippet -
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PortletConfig portletConfig = (PortletConfig)renderRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); | |
LiferayPortletConfig liferayPortletConfig = (LiferayPortletConfig) portletConfig; | |
SessionMessages.add(renderRequest, liferayPortletConfig.getPortletId() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); |
You can also just hide this message by using its css class and calling the alloyui script like this A.all(".classname:first-child").setStyle("display", "none");
ReplyDelete