Hide a tab without update the tabview

UI Components for JSF
Post Reply
f2pro
Posts: 51
Joined: 07 Jan 2011, 18:22
Location: Brazil
Contact:

24 Mar 2011, 21:03

There is a way to hide and show a tab without update all the tabeview?

I would like to hide and show a tab when a radio button is selected or not, so I'm using an ajax function tu update this.. but when I update the Tabview all values are lost

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

31 Mar 2011, 16:47

Hi, this is an old post I know, I was just going through all the recent
tabView posts to get a feel for any known issues etc... I bet you
solved this ages ago, but something like this should work:

Code: Select all

<p:tabView>
  <h:panelGroup id="tabAjaxTarget">
    <p:tab rendered="#{bean.isRadioButtonChecked}">
...

<f:ajax render="tabAjaxTarget"/>
You might need dynamic="true" also.

Brendan.

edudebom
Posts: 70
Joined: 14 Jan 2011, 18:01
Location: Brazil

29 Nov 2011, 11:45

When I use this code my tabs don't appear. Another way ?
Mojarra 2.1.6; GlassFish 3.1.2.2; PrimeFaces 4.0-SNAPSHOT
Brasil

porthos
Posts: 122
Joined: 09 May 2011, 03:17

29 Nov 2011, 14:49

I would think it would be safer to just stick to having <p:tab> as children of <p:tabView>. But that's only good while the tabView is small enough to re-render in its entirety.

Have you tried using <p:outputPanel> instead of <h:panelGroup> to enclose initially unrendered tabs?
-------
PrimeFaces 3.4, Glassfish 3.1.2, Mojarra 2.1.6

edudebom
Posts: 70
Joined: 14 Jan 2011, 18:01
Location: Brazil

29 Nov 2011, 18:07

yes. I tried ..

Code: Select all

        <p:tabView id="tab" dynamic="true">
            <p:outputPanel>
            <p:tab>  
             ...
But the tab doesn't appear.
Mojarra 2.1.6; GlassFish 3.1.2.2; PrimeFaces 4.0-SNAPSHOT
Brasil

porthos
Posts: 122
Joined: 09 May 2011, 03:17

29 Nov 2011, 18:37

Ok. But since you're using lazy loading tabs anyway - surely updating the entire tabView should be pretty quick and small?
-------
PrimeFaces 3.4, Glassfish 3.1.2, Mojarra 2.1.6

SpecialAgent
Posts: 24
Joined: 03 Dec 2009, 22:00

08 Mar 2012, 09:57

Hi,

I do want to update a tab without the entire tabView. This is because I show some Google Adsense Ads on other tabs, and if I update the tabView, the ads disappears. If I could update only one tab, the ads would not be appear.

If i provide an id for one tab and use it in my update attribute nothing happend until I reload the entire page.

Code: Select all

<p:tabView id="tabViewId"
<p:tab id="myTabId" title="Stuff" disabled="#{not stuffPresent}">
..
</p:tab>
..
</p:tabView
Here I can not update the "myTabId".

Thank you.

PS: PrimeFaces 3.1.1. JBOSS AS 7.0.1
JBoss AS 7.1.1
PrimeFaces 3.3.1
PrimeFaces-Extension 0.5.1
PrimeFaces-Mobile 0.9.3
Mojarra 2.1.7-jbossorg-1 (20120227-1401)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 48 guests