Olá Pessoal,
Saberiam me dizer por que os dados somem, quando mudou de uma aba para outra. Quando submeto o form, na primeira aba o valor do atributo é exibido, porém, ao mudar para outra aba, o atributo some, ficando vazio.
OBS: É um exemlo tosco, mas é pq estou começando a mexer agora com JSF. 
Index
<%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
<h:form>
<h:panelGrid columns="1">
<h:messages showDetail="false" showSummary="true" layout="table" />
<h:column>
<h:outputLabel value="Palavra" for="txtPalavra" />:
<h:inputText id="txtPalavra" value="#{palavra.texto}"
required="true" requiredMessage="Favor informar uma palavra" />
</h:column>
</h:panelGrid>
<h:commandButton value="Login" action="#{palavra.atribuir}" />
</h:form>
</f:view>
Página com abas
<%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
<h:form id="form1">
<rich:tabPanel switchType="ajax">
<rich:tab label="Palavra">
Olá, <b><h:outputLabel value="#{palavra.texto}" /></b>!!!
</rich:tab>
<rich:tab label="Quantidade de Letras">
O nome possui <strong><h:outputLabel
value="#{palavra.qtdeLetras}" /></strong> letras.
</rich:tab>
<rich:tab label="Primeira letra">
A letra inicial é <strong><h:outputLabel
value="#{palavra.letraInicial}" /></strong>
</rich:tab>
</rich:tabPanel>
</h:form>
<br>
</f:view>
Bean
package beans;
public class Palavra {
private String texto;
private char letraInicial;
private int qtdeLetras;
public String getTexto() {
return texto;
}
public void setTexto(String texto) {
this.texto = texto;
}
public char getLetraInicial() {
return letraInicial;
}
public void setLetraInicial(char letraInicial) {
this.letraInicial = letraInicial;
}
public int getQtdeLetras() {
return qtdeLetras;
}
public void setQtdeLetras(int qtdeLetras) {
this.qtdeLetras = qtdeLetras;
}
public Palavra(){
}
public String atribuir(){
this.setTexto(texto);
this.setQtdeLetras(texto.length());
this.setLetraInicial(texto.charAt(0));
return "listaPalavra";
}
}
No faces-config.xml, o escopo está como request para o bean Palavra.
Alguma idéia pessoal?
ABraços!
Eduardo
