aspose file tools*
The moose likes JSF and the fly likes rich:tab Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "rich:tab" Watch "rich:tab" New topic


Kranthi Kondapaka
Ranch Hand

Joined: Sep 17, 2007
Posts: 31

i just want to know how to keep enable a tab for all the time(whether it is clicked or not).

Anyone please provide me a solution.
Venkat Sadasivam
Ranch Hand

Joined: May 10, 2008
Posts: 139
By default <rich:tab> tag persist the tab selection at session scope.

"I don't understand what you mean enable a tab all the time".

If you have 2 tabs in a TabbedPanel, only one can be enabled at a time.

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ”<br>
-Martin Fowler
Kranthi Kondapaka
Ranch Hand

Joined: Sep 17, 2007
Posts: 31
Hi venkat,
actually i have four tabs and the first tab is home tab.
when the application is loaded the home tab will be enabled by default.
Under the home tab(which includes many pages) i have many links which will navigate me to other pages.
Once i navigate to other page(by clicking on one of the link) and want to come back to home page,it should be done by clicking on home tab which I am not able to achieve.

It means i should be able to keep alive the home tab all the time.
i think this information is some what clear than the previous one.
so please help me in achieving the solution.
Venkat Sadasivam
Ranch Hand

Joined: May 10, 2008
Posts: 139
Kranthi, sorry to say still it is not clear.

Please provide some examples.
Kranthi Kondapaka
Ranch Hand

Joined: Sep 17, 2007
Posts: 31
Hi Venkat,
this is the home page which constist of four tab and the code is like this

<h:form id="formMain">
<%@ include file="header.jspf"%>
<rich:spacer height="1" />
<rich:tabPanel headerAlignment="center" switchType="ajax">
<rich:tab styleClass="home" label="Home" labelWidth="100px"
action="" id="Home" >
<%@ include file="/WEB-INF/jsp/home.jsp"%>
<%@ include file="/WEB-INF/jsp/seemorevideos.jsp"%>
<rich:tab styleClass="category" label="Category" labelWidth="100px"
action="#{CategoryData.listOfCategories}" id="Category">
<%@ include file="/WEB-INF/jsp/category.jsp"%>
<rich:tab styleClass="community" label="Community"
labelWidth="100px" id="Community" action="#{CommunityData.communitiesGroup}">
<%@ include file="/WEB-INF/jsp/community.jsp"%>
<rich:tab styleClass="studio" label="Studio" labelWidth="100px"
action="" id="Studio">
<%@ include file="/WEB-INF/jsp/studio.jsp"%>
<rich:tab styleClass="favorities" label="Favorities" labelWidth="100px"
id="favorities" reRender="videomessage" action="#{FavoriteVideos.favoritevideos}">
<%@ include file="/WEB-INF/jsp/favoriteVideosimage.jsp"%>
<%@ include file="/WEB-INF/jsp/player.jsp"%>
<%@ include file="/searchContent.jsp"%>

Now in this page i want to always keep the home tab enabled.
Mohammad Ali Mohsin

Joined: Jan 04, 2010
Posts: 1
Dear Kranthi,
We can permanently select our selected tab by giving
<rich:tabPanel selectedTab="#{nameofmanagedbean.selectedTab}" whereas selectedTab is the property of managed bean. In managed bean we can permanently select our selected tab by hardcoding it to

selectedTab = "name of tab you want to select";

Hope this might help you.

I agree. Here's the link:
subject: rich:tab