problem with p:tabView and p:tab

UI Components for JSF
Post Reply
thiagoativa
Posts: 22
Joined: 29 Jul 2010, 01:07

30 Jul 2010, 16:06

Hello people!

I'm having a problem with p:tabView and p:tab
in my case, I have 2 tabs inside a tabView but both are displayed in the page. They hold the same anchor. But if I click in the button that reRender the page, the tabs are showed properly.

what's happen?

my web.xml is configured properly, i'm using prime faces 1.0.2 and JSF 1.2

follow the screenshot and code. Who could help me?

Best regards!

Image

CODE:

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:m="http://code.google.com/p/gmaps4jsf/"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      content='text/html; charset=ISO-8859-1' http-equiv='Content-Type'>
   
    <p:resources>
    <p:panel style="width:100pc; height:500px;margin:0pc;">
      <h:form id="form1">
         <f:facet name="header">
                 <h:outputText value="Cadastro de Contas" />
            </f:facet>
           
            <p:tabView effect="opacity" effectDuration="normal" style="height:100pc;text-align:center;width:100pc">
              <p:tab id="tp1" title="Informações">
                  <h:panelGrid id="pg1" columns="2" style="padding-right:15pc;padding-left:15pc;padding-top:5pc;width:70pc;">
                     <f:facet name="header">
                        <h:outputText value="Forneça as informações da nova conta" style="color:DARK GREY;width:70pc;font-family:Calibri;"/>
                  </f:facet>
                     
                     <h:outputText id="ot1" value="" style="visibility:hidden;"/>
                     <h:inputText id="it1" value="" style="visibility:hidden;"/>
                     
                     <h:outputText id="ot2" value="Nome da conta:" style="font-family: Calibri;font-weight: bold;padding: 3px;"/>
                     <h:inputText id="it2" value="#{contasBean.conta.nome}" style="font-family:Calibri;width : 250px;padding:3px;" maxlength="100"/>
                     
                     <h:outputText id="ot3" value="" style="visibility:hidden;"/>
                     <h:outputText id="ot4" value="" style="visibility:hidden;"/>
                     
                     <h:outputText id="ot5" value="Nome do responsável:" style="font-family: Calibri;font-weight: bold;padding: 3px;"/>
                     <h:inputText id="it3" value="#{contasBean.conta.responsavel}" style="font-family:Calibri;width : 355px;padding:3px;" maxlength="100"/>
                     
                     <h:outputText id="ot6" value="" style="visibility:hidden;"/>
                     <h:outputText value="" style="visibility:hidden;"/>
                     
                     <h:outputText id="ot7" value="E-mail de contato:" style="font-family: Calibri;font-weight: bold;padding: 3px;"/>
                     <h:inputText id="it4" value="#{contasBean.conta.email}" style="font-family:Calibri;width : 355px;padding:3px;" maxlength="100"/>
                     
                     <h:outputText id="ot8" value="" style="visibility:hidden;"/>
                     <h:outputText id="ot9" value="" style="visibility:hidden;"/>
                     
                     <h:outputText id="ot10" value="Telefone de contato:" style="font-family: Calibri;font-weight: bold;padding: 3px;"/>
                     <h:inputText id="it5" value="#{contasBean.conta.telefone}" style="font-family:Calibri;width : 130px;padding:3px;" maxlength="45"/>
                    
                     <h:inputText value="" style="visibility:hidden;"/>
                     <h:inputText value="" style="visibility:hidden;"/>
                  </h:panelGrid>
                    
                    <h:panelGrid columns="1" style="padding-left:15pc;padding-right:15pc;text-align:center;width:70pc;">
                  <p:messages showDetail="true"/>
                  <!--<h:outputText value="#{contasBean.msgCadastro}" style="text-align:center;color:RED;font-size:small;font-style:normal;font-family:Calibri;font-weight:bolder;"/>-->
               </h:panelGrid>
                    
                  <h:panelGrid columns="2" style="padding-left:15pc;padding-right:15pc;text-align:center;width:70pc;background-color:Teal;">
                     <h:commandButton value="Gravar dados" update="msgs" actionListener="#{contasBean.persist}"/>
                     <a4j:commandButton reRender="form1" type="reset" action="#{contasBean.limpaCampos}" value="Limpar campos"/>
               </h:panelGrid>
              </p:tab>
             
              <p:tab title="Opções">
                  <h:panelGrid id="pg2" columns="2" style="padding-right:15pc;padding-left:15pc;padding-top:5pc;width:70pc;">
                     <f:facet name="header">
                        <h:outputText value="Forneça as informações da nova conta" style="color:DARK GREY;width:70pc;font-family:Calibri;"/>
                  </f:facet>
                  
                  <h:outputText value="" style="visibility:hidden;"/>
                     <h:inputText value="" style="visibility:hidden;"/>
                     
                     <h:outputText value="Habilitar conta:" style="text-align:center;font-family: Calibri;font-weight: bold;padding: 3px;"/>
                     <h:selectBooleanCheckbox id="cb1" value="#{contasBean.habilitaConta}" style="font-family:Calibri;padding: 3px;"/>
                     
                     <h:outputText value="" style="visibility:hidden;"/>
                     <h:inputText value="" style="visibility:hidden;"/>
                 
                     <h:outputText value="Habilitar alarme sonoro:" style="text-align:center;font-family: Calibri;font-weight: bold;padding: 3px;"/>
                     <h:selectBooleanCheckbox onclick="submit();" id="cb2" converter="javax.faces.Boolean" value="#{contasBean.habilitaAlarmeSonoro}" valueChangeListener="#{contasBean.musicChange}" style="font-family:Calibri;padding: 3px;"/>
                     
                     <h:outputText value="" style="visibility:hidden;"/>
                     <h:inputText value="" style="visibility:hidden;"/>
                     
                     <h:outputText value="Selecione o som:" style="text-align:center;font-family: Calibri;font-weight: bold;padding: 3px;"/>
                     <h:selectOneMenu disabled="#{!contasBean.habilitaAlarmeSonoro}" style="width:300px;font-family:Calibri;padding: 3px;">
                        <f:selectItem itemValue="bip simples" />
                  </h:selectOneMenu>
                  
                  <h:inputText value="" style="visibility:hidden;"/>
                  <h:inputText value="" style="visibility:hidden;"/>
                     
               </h:panelGrid>
               
               <h:panelGrid columns="1" style="padding-left:15pc;padding-right:15pc;text-align:center;width:70pc;">
                  <!--<h:outputText value="#{contasBean.msgCadastro}" style="text-align:center;color:RED;font-size:small;font-style:normal;font-family:Calibri;font-weight:bolder;"/>-->
               </h:panelGrid>
               
               <h:panelGrid columns="2" style="padding-left:15pc;padding-right:15pc;text-align:center;width:70pc;background-color:Teal;">
                     <h:commandButton value="Gravar dados" actionListener="#{contasBean.persist}"/>
                     <a4j:commandButton reRender="form1" type="reset" action="#{contasBean.limpaCampos}" value="Limpar campos"/>
               </h:panelGrid>
              </p:tab>
          </p:tabView>
       </h:form>
   </p:panel>
   </p:resources>
</ui:composition>

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Jul 2010, 16:14

1.0.2 is quite old and tabView is reimplemented in 1.1. release. You might try upgrading and see if issue persists.

thiagoativa
Posts: 22
Joined: 29 Jul 2010, 01:07

30 Jul 2010, 17:01

optimus,

I did it, but now, when I access the page in the first time, the page skin is not applied(in version 1.0.2 was applied).
If I click in the button "Limpar campos"(reRender page), the skin is applied and the tabs work properly(same of 1.0.2).

follow the screenshot of this. what can be?
thanks!

first access when is displayed without skin
Image

If I click in button "Limpar campos" that reREnder, the skin and effects are applied
Image

thiagoativa
Posts: 22
Joined: 29 Jul 2010, 01:07

30 Jul 2010, 19:39

Hello optmius? could you help me?

thiagoativa
Posts: 22
Joined: 29 Jul 2010, 01:07

30 Jul 2010, 21:16

somebody can help me ?????????????????????????? PLEASE!

thiagoativa
Posts: 22
Joined: 29 Jul 2010, 01:07

30 Jul 2010, 21:52

the Rich:tabPanel is working very well, but p:tabView is not showed with skin. It's happens when I use reRender function. Who knows what happen?

hey optimus.prime, could you help me??? PLEASE!

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Jul 2010, 23:47

Hi,

Please take a moment to read forum guideline especially number #3.

http://primefaces.prime.com.tr/forum/vi ... f=3&t=1194

I've responsed already to your other post.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot], Mordets, speandHap and 14 guests