Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8115741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:34:02+00:00 2026-06-06T03:34:02+00:00

I am using liferay ui tabs in my project. I would like to call

  • 0

I am using liferay ui tabs in my project. I would like to call the controller on click of the tabs. I used portlerURL attribute for try but its not working.

Here is my code snippet :-

view.jsp

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet"%>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme"%>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>


<liferay-theme:defineObjects />
<portlet:defineObjects />


<liferay-portlet:renderURL var="portletURL" />

<%
    //We must Specify a default value for tabs. In this example it is sunday. Else it //will throw an error.
    String tabValue = ParamUtil.getString(request, "tab", "sunday");
    String tabsURL = "/" + tabValue.trim() + ".jsp";
    String tabNames = "Sunday,Monday,Tuesday";
    String tabVal = "sunday,monday,tuesday";
    if (permissionChecker.isCompanyAdmin(themeDisplay.getCompanyId())) {
        tabNames += ",Admin";
        tabVal += ",admin";
    }

    PortletURL URL = renderResponse.createActionURL();
    URL.setParameter("click","tabClick");
%>

<liferay-ui:tabs names="<%=tabNames%>" tabsValues="<%=tabVal%>" param="tab" url="<%= portletURL %>" />

<c:import url="<%= tabsURL %>"></c:import>

Controller :-

import com.liferay.util.bridges.mvc.MVCPortlet;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;

/**
 * Portlet implementation class TabDemoPortlet
 */
public class TabDemoPortlet extends MVCPortlet {

    public void sunday(ActionRequest req,ActionResponse res) {
        System.out.println("Hello Sunday!!!");
    }

    public void monday(ActionRequest req,ActionResponse res) {
        System.out.println("Hello Monday!!!");
    }

    public void tuesday(ActionRequest req,ActionResponse res) {
        System.out.println("Hello Tuesday!!!");
    }
}

All suggestions are welcome. Thanks in advance!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:34:04+00:00Added an answer on June 6, 2026 at 3:34 am

    You have to create multiple actionURLs and use them in you liferay-ui:tabs. Some thing like this

    <portlet:actionURL name="sunday" var ="sundayURL"/>
    <portlet:actionURL name="monday" var ="mondayURL"/>
    <portlet:actionURL name="tuesday" var ="tuesdayURL"/>
    
    <liferay-ui:tabs names="<%=tabNames%>" 
       url0="<%=sundayURL/>"
       url1="<%=mondayURL/>"
       url2="<%=tuesdayURL/>"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm loading yui.js 3.3.0 version file from portlet but liferay its using 3.2.0 yui.js
Using a restful resource in Rails, I would like to be able to insert
Using Flex 3, I would like to take an image snapshot such as this:
I'm using Liferay but I guess it's more of a Spring question. In Liferay,
I'm using jsp of out-of-box portlet like feed.jspf in Liferay 6: String articleId =null;
I've been using Liferay a lot for past 2 years, but I have never
I am using liferay search container to display list of information, but in that
I'm using the search plugin of Liferay 6.1, but I noted that the news
I am using Liferay 6 . I have read that Liferay Hooks can be
I had Solr 1.2 up and running at port 8983 and using liferay 5.1.1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.