Friday, 12 December 2014

How to remove default success message in liferay

Add the shaded code in your portlet.xml file

<portlet>
<portlet-name>forgotpassword</portlet-name>
<display-name>forgot Password</display-name>
<portlet-class>com.test.forgotPassword</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/forgotpassword/view.jsp</value>

</init-param>
<init-param>
                   <name>add-process-action-success-action</name>
                   <value>false</value>
             </init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>

<portlet-info>
<title>forgot Password</title>
<short-title>forgot Password</short-title>

<keywords></keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>

you can also change session message through action class

SessionMessages.add(actionRequest, "request_processed", "your msg will be here");

addProcessActionSuccessMessage= false;

No comments: