Liferay tabs:
Create the jsps :sunday,monday,tuesday,admin pages:
In view.jsp write the code like this:
<%@ 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 />

<%--A renderURL is created because we need to render a jsp page you need to use renderURL we can also  pass parameters if required--%>

<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 = "/html/tab/" + tabValue.trim() + ".jsp";
String tabNames="Sunday,Monday,Tuesday" ;
String tabVal="sunday,monday,tuesday" ;
if(permissionChecker.isCompanyAdmin(themeDisplay.getCompanyId()))
{
tabNames+=",Admin" ;
tabVal+=",admin" ;
}
%>

<liferay-ui:tabs
names="<%=tabNames%>"
tabsValues="<%=tabVal%>"
param="tab"
url="<%= portletURL %>"
/>
Add  the following jar files in liferay-plugin-packages.properties:

Jstl-api.jar and jstl-impl.jar files, add c.tld file

Search This Blog

All the rights are reserved to this blog is belongs to me only.. Powered by Blogger.