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

  • Home
  • SEARCH
  • 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 8526123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:10:56+00:00 2026-06-11T08:10:56+00:00

I want to change tab from backing bean , how can I do that?

  • 0

I want to change tab from backing bean , how can I do that?

<h:form id=form>  

    <p:growl id="growl" showDetail="true" />  

    <p:tabView id="tabView" dynamic="true" widgetVar="detailsTab">  

        <p:ajax event="tabChange" listener="#{bean.onTabChange}" update=":form:growl"/>  

        <p:tab title="Tab1" id="emp">  
            <h:panelGrid columns="2" cellpadding="10">  


              </h:panelGrid>  
        </p:tab>  

        <p:tab title="Tab 2 " id="schedule1">  
            <h:panelGrid columns="2" cellpadding="10">  


            </h:panelGrid>  



        </p:tab>  

        <p:tab title="Tab 3" id="schedule2">  
        <p:schedule value="#{bean.eventModel}" slotMinutes="15" 
                            resizable="false" widgetVar="schdule" initialDate="#{bean.dates}" draggable="true" styleClass="#{bean.selDates}"
                             >
                             <p:ajax event="dateSelect" listener="#{bean.onDateSelect}"
                                update="dialogBox"  oncomplete="patScheduleDialog.show()"/>
                              <p:ajax event="eventSelect" listener="#{bean.onEventSelect}" 
                                update="dialogBox :form:growl" oncomplete="#{bean.pevent}"/>
                                <p:ajax event="eventMove" listener="#{bean.onEventMove}"
                                update="dialogBox, :form:growl" />
                        </p:schedule>

         <p:dialog id="dialogBox" header="Patient's Appointment Details" widgetVar="patScheduleDialog" resizable="true"  
                                 showEffect="explode" hideEffect="explode">  

                <h:panelGrid id="eventDetails" columns="2">  
            <h:outputLabel for="title" value="Title:" />  
            <p:inputText id="title" value="#{bean.event.title}" required="true"/>  

            <h:outputLabel for="from" value="From:" />  
            <p:inputMask id="from" value="#{bean.event.startDate}" mask="99/99/9999">  
                <f:convertDateTime pattern="dd/MM/yyyy" />  
            </p:inputMask>  

            <h:outputLabel for="to" value="To:" />  
            <p:inputMask id="to" value="#{bean.event.endDate}" mask="99/99/9999">  
                <f:convertDateTime pattern="dd/MM/yyyy" />  
            </p:inputMask>  

            <h:outputLabel for="allDay" value="All Day:" />  
            <h:selectBooleanCheckbox id="allDay" value="#{bean.event.allDay}" />  

            <p:commandButton type="reset" value="Reset" />  
            <p:commandButton value="Save" actionListener="#{bean.addEvent}" oncomplete="schdule.update();dialogBox.hide();"/>  
        </h:panelGrid>  


    </p:dialog>


        </p:tab>  

    </p:tabView>  


  public void onEventSelect(ScheduleEntrySelectEvent selectEvent){

    // what should I need to do here to set "Tab 2" if click on any event.


    }
  • 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-11T08:10:58+00:00Added an answer on June 11, 2026 at 8:10 am

    First, you need to set the activeIndex attribute of your <p:tabView>, like this: <p:tabView activeIndex="#{bean.selectedTab}">. It’s an Integer.

    Second, in your bean method, whenever you want to change the active tab, set selectedTab to the tab you want to be selected.

    Third, remember to update the <p:tabView>.


    You could also do that using JavaScript. Just set the widgetVar attribute of your <p:tabView>, like this: <p:tabView widgetVar="myTabView">.

    Then use the JavaScript function myTabView.select(tabIndex), where tabIndex is the index of the tab you want to select.

    You can do that at any javascript event, for example: <p:commandButton oncomplete="myTabView.select(1)" /> would select the second tab after the action of the commandButton completed.


    Make sure you read PrimeFaces docs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i change TabIndex from tab to enter for all forms in my
I want to change the colour of a tabview from the default grey (and
Can I change column header in Jtable tab from Name to Surname if I
I want to change the background color of a textbox as an indicator that
I have a form in MS Access 2007. To change from one inputfield to
I am working with a coolite tabpanel. I want to handle the tab change
I want to change in my .NET application login of user from Active Directory.
In my application i have Tab bar Controller. I want to change default color
i want change the content of a UITableView when i change a button, how
I want change following javascript code to jquery code, How is it? With done

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.