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 7049575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:02:03+00:00 2026-05-28T03:02:03+00:00

In my app, when a user clicks on some item, I use <p:tabView> inside

  • 0

In my app, when a user clicks on some item, I use <p:tabView> inside <p:dialog> to show the details of that item. Based on the item type, some will have extra tabs. It is similar to the following:

<p:dataTable value="#{mrBean.items}" var="item" >
   <p:ajax event="rowSelect" listener="#{mrBean.showItemDetails}" update="itemDetails" oncomplete="eventDialog.show();" />
   ...
</p:schedule>

<p:dialog id="detailsDlg" onHide="detailsTab.select(0);">
   <p:tabView effect="fade" widgetVar="detailsTab" id="itemDetails">
      <tab title="General details">
         ...
      </tab>

      <tab rendered="#{mrBean.item.type == 'Book'}" title="Author">
         ...
      </tab>
   </p:tabView>
</p:dialog>

Consider the situation when I click a Book and navigate to the Author tab to view the Author’s details. Now, if I close the dialog without switching back to the General details tab and I click some items other than Book (which means they don’t have Author tab), my dialog appeared to be still on the invisible Author tab. Even if I try to click on the General tab, it will not render anymore.

UPDATE:

I tried to use the client-side API of <p:tabView> and <p:dialog> and make a call to detailsTab.select(0) in the onHide attribute of <p:dialog>. The situation is a bit better. However, the 1st item, which is not a Book, that I click after I click a Book will experience the same situation as above. From the 2nd item onward, everything is OK again. Are there any ways to make it work right away?

I’d be very grateful if you could show me how I can solve this problem.

  • 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-05-28T03:02:04+00:00Added an answer on May 28, 2026 at 3:02 am

    I finally found the solution. In the <p:tabView> tag, I tried to have some effect by setting effect="fade". I think the effect might have caused some lag in code execution and thus, I couldn’t see the result of the tab switching until the next request.

    After I turned off the effect and put detailsTab.select(0); in the oncomplete attribute of my <p:ajax> event, it’s working now.

    <p:dataTable value="#{mrBean.items}" var="item" >
       <p:ajax event="rowSelect" listener="#{mrBean.showItemDetails}" 
               update="itemDetails" oncomplete="eventDialog.show();detailsTab.select(0);" />
       ...
    </p:schedule>
    
    <p:dialog>
       <p:tabView widgetVar="detailsTab" id="itemDetails">
          <tab title="General details">
             ...
          </tab>
    
          <tab rendered="#{mrBean.item.type == 'Book'}" title="Author">
             ...
          </tab>
       </p:tabView>
    </p:dialog>
    

    One thing to note is that when I turned off the effect without putting detailsTab.select(0); in the oncomplete attribute of my <p:ajax> event, this problem still occurred. In other words, the dialog still ended up showing the invisible tab. However, when I clicked on the General tab, the content of this tab was rendered perfectly. The problem obviously happened only when I was using effect. This may be a bug of <p:tabView>.

    I think my solution is not very elegant because I had to turn off the effect :P. If you could provide any solutions which can works with effect, I’d be very happy to accept your answer :).

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

Sidebar

Related Questions

In my app I have a ListView when user click on an item some
I have got some inapp billing in my Android app. When the user clicks
I'm trying to create an app in Visual Basic that will allow a user
In my flex app I have some radio buttons. When a user clicks the
I'm trying to write an Android app that will allow a user to search
In my typical app, the user clicks a button in an aspx page, invokes
My app should render html, to answer when a user clicks ajax-link. My controller:
I need a function that a user can just click a flash app button
I'm developing web app that user can save his/her work to server. The data
I'm coding a windows phone 7.1 app, and when the user clicks a specific

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.