Ae galera...
to com uma duvida em relação a navegação orientada a estado, estou tentando implementar um projeto com JSF + Facelets + RichFAces mas estou perdido na parte de navegação de paginas, axei um exemplo na internet mas não consegui rodar por exemplo tenho o WizardBean que vai controlar a navegação
public class WizardBean implements Serializable {
private static final String STAGE_1 = "estagio_1";
private static final String STAGE_2 = "estagio_2";
private static final String STAGE_3 = "estagio_3";
private String currentStage = STAGE_1;
public WizardBean() {
}
public String getCurrentStage() {
return currentStage;
}
public void setCurrentStage(String currentStage) {
this.currentStage = currentStage;
}
public void setStage1() {
this.setCurrentStage(STAGE_1);
}
public void setStage2() {
this.setCurrentStage(STAGE_2);
}
public void setStage3() {
this.setCurrentStage(STAGE_3);
}
public boolean isStage1() {
return (this.getCurrentStage().equals(STAGE_1));
}
public boolean isStage2() {
return (this.getCurrentStage().equals(STAGE_2));
}
public boolean isStage3() {
return (this.getCurrentStage().equals(STAGE_3));
}
}
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="./css/default.css" rel="stylesheet" type="text/css" />
<link href="./css/cssLayout.css" rel="stylesheet" type="text/css" />
<title>Facelets Template</title>
</head>
<body>
<a4j:region>
<rich:panel styleClass="wizard-all" rendered="#{panelMenu.wizardState}" id="WizardPanel">
<f:facet name="header">
<h:outputText value="Assistente de Configuração" />
</f:facet>
<h:form rendered="#{WizardBean.stage1}">
<div id="wizard-top">
<p>
Fase 1
</p>
<div id="wizard-buttons">
<a4j:commandButton action="#{WizardBean.setStage2}" value="Avançar >>"
style="float:right;"/>
</div>
</div>
</h:form>
<h:form rendered="#{WizardBean.stage2}">
<div id="wizard-top">
<p>
fase 2
</p>
<div id="wizard-buttons">
<a4j:commandButton action="#{WizardBean.setStage3}" value="Avançar >>" style="float:right;"/>
<a4j:commandButton action="#{WizardBean.setStage1}" value="<< Voltar" style="float:left;"/>
</div>
</div>
</h:form>
</rich:panel>
<!-- Fecha a tag que foi introduzida -->
</a4j:region>
</body>
</html>
<rich:panel styleClass="wizard-all" rendered="#{panelMenu.wizardState}" id="WizardPanel">
não entendi porque do panelMenu e nem da onde veio, com isso a pagina executa e fica em branco, outra coisa essa é a melhor maneira para fazer a navegação orientada a estado??
Obrigado.