Issue
- The error message that appears in a widget whenever the user wants to launch an error, sometimes the message appears at the bottom of the page and others at the top. For example, the same portlet twice in a row generates the message in two different places.
Environment
- Liferay DXP 7.1
Resolution
-
The tag
<liferay-ui:error>is configurable in several aspects and one of them is the position or the way in which the message is displayed which is controlled by the attributeembed:
-
When it
embedhas the valuetrue(by default), the message is displayed in the same place where the tag was invoked. -
When it
embedhas the valuefalse(for example:)<liferay-ui:error embed="<%= false %>" key="error401" message="error401"/>, the message is displayed floating down to the left.
-
When it
Additional Information
-
Code references:
- JSP that paints the message: https://github.com/liferay/liferay-portal/blob/7.1.x/portal-web/docroot/html/taglib/ui/error/page.jsp
- Information tag: https://github.com/liferay/liferay-portal/blob/7.1.x/util-taglib/src/META-INF/liferay-ui.tld#L723-L776
- Java class: https://github.com/liferay/liferay-portal/blob/7.1.x/util-taglib/src/com/liferay/taglib/ui/ErrorTag.java