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!
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>