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.
Asked
Active
Viewed 5,024 times
3
-
Where do you want use redirect / back URL? Is it a default portlet or custom portlet? – Parkash Kumar Apr 15 '15 at 10:10
-
@parakash Kumar In my custom portlet which is deployed under control panel. – Vinod Apr 15 '15 at 11:07
-
1Create a renderURL in your main view, pass it as request parameter and get on second jsp, assign this url to the a / button. This URL will work as back URL on current page. – Parkash Kumar Apr 15 '15 at 12:09
2 Answers
4
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>

Haris
- 1,131
- 7
- 20
-
1Lets resolve one by one. Which theme did you apply for page ? It should be Welcome-theme to get the icon that you mentioned in query. – Haris Apr 15 '15 at 08:42
-
1Theme is applied to page not portlet. You need to make sure first that your portlet is on a page for which Welcome Theme is applied. you can click on edit page and see the current theme applied to page – Haris Apr 15 '15 at 09:47
-
1Can you tell me what theme selected for control panel ? Go to: Control Panel → Portal Settings → Display Settings → Look and Feel → Default Control Panel Theme – Haris Apr 15 '15 at 10:02
-
-
-
I tried by changing the default theme to "Welcome" still I am not be able to see the back button icon. I am able to see only the label – Vinod Apr 15 '15 at 13:40
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/75293/discussion-between-haris-and-vinod). – Haris Apr 15 '15 at 13:42
-
I' am getting this error with this solution: 13:06:58,436 ERROR [http-bio-8080-exec-22][render_portlet_jsp:132] null javax.portlet.PortletException: Path /web/guest/home?....[correct path and jsp name]jsp is not accessible by this portlet – Simone Celia Jun 27 '19 at 13:31
-1
Try this instead. Just use one line and it will direct back to previous URL.(Place this code in second jsp).
<input type=button value=" Back" onClick="javascript: window.history.go(-1)" text-align="right">

Mark Rotteveel
- 100,966
- 191
- 140
- 197

Shahesta
- 1
-
You say "this code", but there isn't any code in your answer. Could you please put the code in that will solve the problem? Thanks. – paulmorriss Jan 09 '19 at 10:35