Search code examples
liferayliferay-6liferay-themeliferay-aui

How can we create the back button in liferay


Can any one tell me how can I create the back button in my portlet. Are there any existing tags to create the back button which looks like as shared below.

enter image description here


Solution

  • Solution as mentioned in below post should work.

    http://www.liferay.com/en_GB/community/forums/-/message_boards/message/22392288

    Liferay uses back URL in many of its default portlets. For example, You can refer sources for message board portlet - view.jsp, edit_category.jsp

    If you use to move from first JSP to second JSP, then backURL should be passed as argument in first JSP and retrieve in second JSP to use inside liferay-ui:header tag.

    For example,

    <portlet:renderURL var="varURL"> 
    <portlet:param name="mvcPath" value="<second-JSP-URL>"></portlet:param>
    <portlet:param name="backURL" value="<%= themeDisplay.getURLCurrent() %>"></portlet:param>
    </portlet:renderURL>