By Cesário Lange


2015-09-23 12:43:27 8 Comments

i have a "problem" with a tab component for tabView from Primefaces. I did a tabView with dynamic tabs based on a array.

But some tabs can't be rendered, based on a boolean attribute of the object from that array .

I tried rendered="true" or "false" but nothing happens (on tab). I use rendered="#{_item.show}" i tried use disabled feature and works fine, but is not my need.

Someone have an idea to how to solve this issue?

check my code:

<p:tabView id="tabs" value="#{myBean.list}" var="_item"  orientation="left" style="height:800px!important;" >

        <p:tab title="#{_item}" rendered="#{_item.show}" >

1 comments

@Geinmachi 2015-09-23 17:19:37

Add disabled attribute to your <p:tab> and use this style for hiding tab:

<style>
    #tabs li.ui-state-disabled {
        display: none;
    }
</style>

Value after # is your <p:tabView> clientId, so if it is in a naming container like <h:form id="myForm"> then just change your selector to #myForm\:tabs.

rendered="false" works but it doesn't render content of the tab, not the tab itself.

@Cesário Lange 2015-09-28 20:27:02

I did this and worked well... Use css to solve this was my last option. But thanks for the help

Related Questions

Sponsored Content

1 Answered Questions

Primefaces tabview validation with dynamic tab

2 Answered Questions

[SOLVED] Combination of fixed and dynamic tabs in PrimeFaces TabView

1 Answered Questions

1 Answered Questions

set height of p:tabView

  • 2017-07-17 14:39:35
  • user2711115
  • 971 View
  • 0 Score
  • 1 Answer
  • Tags:   primefaces tabview

2 Answered Questions

[SOLVED] PrimeFaces rendered attribute impact on performance

  • 2017-03-21 11:41:07
  • RedaN
  • 517 View
  • 0 Score
  • 2 Answer
  • Tags:   jsf primefaces

1 Answered Questions

[SOLVED] Primefaces update only selected tab

1 Answered Questions

PrimeFaces, can’t update tab disabled attribute

  • 2014-04-11 00:09:28
  • youngm
  • 1134 View
  • 1 Score
  • 1 Answer
  • Tags:   jsf primefaces

1 Answered Questions

Declaring a new renderer for TabView component

Sponsored Content