Problemas JSF 2.0 - Richfaces 4

Bom dia pessoal,

Estou iniciando estudos em JSF 2 com Richfaces 4, e estou tendo alguns problemas, gostaria de pedir a ajuda da galera mais experiente na tecnologia para tentar clarear as ideias.

Tenho uma jsp com campos dinamicos, onde minha página inicial possui 2 campos, ‘nome’ e ‘login’, e 2 botões, ‘Pesquisar’, onde o usuário pode pesquisar utilizando os campos anterior como filtro, e ‘Incluir’, onde ao clicar o sistema exibe outros 3 campos, ‘data de nascimento’, ‘email’ e telefone, e inibe os botões citados anteriormente e exibe os botões Salvar, onde o sistema deverá persistir os dados inputados e ‘Cancelar’ que voltará para a tela inicial.

Meu problema é que quando clico nos botões ‘Salvar’ e ‘Cancelar’, que são renderizados dinamicamente, os actions do commandButton não estão chamando os seus respectivos metodos no MBean, nem populando os atributos mapeados pelos inputText’s.

Desconfio que seja algum problema de ajax, pois possuo uma tela como comportamente similar em um sistema do trabalho que funciona perfeitamente usando JSF 1.2, mas não tenho certeza se o problema é este e nem como contorna-lo.

Gostaria de pedir a ajuda do pessoal para identificar onde estou errando ou se estou tentando fazer algo inviavel, pois já estou batendo cabeça a algum tempo com isso e até agora sem sucesso.

JSF:

<?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">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich" template="/jsp/template.xhtml">
	<ui:define name="conteudo">
		<f:view>
			<h:form id="formulario" >
				<div>
					<rich:messages ajaxRendered="true" globalOnly="true"/>
				</div>
				<a4j:region id="regiaoPesquisa">
					<div>
						<h:outputLabel value="Nome" for="nomeId" />
						<h:inputText value="#{Usuario.nome}" id="nomeId"/>
					</div>
					<div>
						<h:outputLabel value="Login" for="loginId" />
						<h:inputText value="#{Usuario.login}" id="loginId" />
					</div>
				</a4j:region>
				<a4j:outputPanel id="painelCadastroId">
					<a4j:region rendered="#{Usuario.exibirModoCadastro}">
					<div>
						<h:outputLabel value="E-mail" for="emailId" />
						<h:inputText value="#{Usuario.email}" id="emailId" />
						<rich:message for="emailId" />
					</div>
					<div>
						<h:outputLabel value="Telefone" for="telefoneId" />
						<h:inputText value="#{Usuario.telefone}" id="telefoneId" />
						<rich:message for="telefoneId" />
					</div>
					<div>
						<h:outputLabel value="Data Nascimento" for="dataNascimentoId" />
						<h:inputText value="#{Usuario.dataNascimento}" id="dataNascimentoId" />
						<rich:message for="dataNascimentoId" />
					</div>
					</a4j:region>
				</a4j:outputPanel>
				<div>
					<a4j:outputPanel id="painelBotoesId">
						<a4j:outputPanel id="painelBotoesInicial" rendered="#{Usuario.exibirModoInicial}">
							<a4j:commandButton action="#{Usuario.incluir}" value="Incluir" execute="regiaoPesquisa" render="formulario,painelBotoesCadastro, painelCadastroId, painelBotoesId, painelResultado"/>
							<a4j:commandButton action="#{Usuario.pesquisar}" value="Pesquisar" execute="regiaoPesquisa" render="painelCadastroId, painelBotoesId, painelResultado" />
						</a4j:outputPanel>
						<a4j:outputPanel id="painelBotoesCadastro" rendered="#{Usuario.exibirModoCadastro}">
							<a4j:commandButton action="#{Usuario.salvar}" value="Salvar" render="painelCadastroId, painelBotoesId, painelResultado"/>
							<a4j:commandButton action="#{Usuario.excluir}" value="Excluir" rendered="#{Usuario.exibirModoExclusao}" render="painelCadastroId, painelBotoesId, painelResultado" />
							<a4j:commandButton action="#{Usuario.cancelar}" value="Cancelar" render="painelCadastroId, painelBotoesId, painelResultado" />
						</a4j:outputPanel>
					</a4j:outputPanel>
				</div>
				<a4j:outputPanel id="painelResultado">
					<rich:dataTable value="#{Usuario.listaUsuario}" var="item" rendered="#{Usuario.exibirModoInicial}">
						<f:facet name="header">
							<rich:columnGroup>
								<rich:column>
									<h:outputText value="Nome" />
								</rich:column>
								<rich:column>
									<h:outputText value="Login" />
								</rich:column>
								<rich:column>
									<h:outputText value="Data de Nascimento" />
								</rich:column>
							</rich:columnGroup>
						</f:facet>
						<rich:column>
							<h:outputText value="#{item.nome}" />
						</rich:column>
						<rich:column>
							<h:outputText value="#{item.login}" />
						</rich:column>
						<rich:column>
							<h:outputText value="#{item.dataNascimento}">
								<f:convertDateTime pattern="dd/MM/yyyy" />
							</h:outputText>
						</rich:column>
					</rich:dataTable>
				</a4j:outputPanel>
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>

MBEAN:

@RequestScoped
@ManagedBean(name="Usuario")
public class UsuarioMBean {
	
	@NotNull(message="Nome não informado")
	private String nome;
	
	@NotNull(message="Login não informado")
	private String login;
	
	@NotNull(message="Data de Nascimento não informado")
	@Past(message="Data precisa ser menor ou igual que a data atual")
	private Date dataNascimento;
	
	@NotNull(message="E-mail não informado")
	@Pattern(regexp = "^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[a-zA-Z]{2,4}$", message = "E-mail Invalido")
	private String email;
	
	@Pattern(regexp = "\\(\\d{3}\\)\\d{4}-\\d{4}", message="Telefone: preencha no formato (XXX)XXXX-XXXX")
	private String telefone;
	
	private boolean inativacao;
	
	private final List<Usuario> listaUsuario = new ArrayList<Usuario>();
	
	private boolean exibirModoInicial;
	private boolean exibirModoCadastro;
	private boolean exibirModoExclusao;

	private boolean desabilitarFormulario;
	
	private final static int MODO_INICIAL = 1;
	private final static int MODO_CADASTRO = 2;
	private final static int MODO_VISUALIZACAO = 3;
	private final static int MODO_ALTERACAO = 4;
	private final static int MODO_EXCLUSAO = 5;
	
	@PostConstruct
	public void inicializar(){
		listaUsuario.add(new Usuario("nome1", "login", "senha", new Date(), "email", "telefone1"));
		listaUsuario.add(new Usuario("nome2", "login", "senha", new Date(), "email", "telefone2"));
		listaUsuario.add(new Usuario("nome3", "login", "senha", new Date(), "email", "telefone3"));
		listaUsuario.add(new Usuario("nome4", "login", "senha", new Date(), "email", "telefone4"));
		listaUsuario.add(new Usuario("nome5", "login", "senha", new Date(), "email", "telefone5"));
		
		//
		exibirModoInicial = true;
		exibirModoCadastro = false;
		exibirModoExclusao = false;
		desabilitarFormulario = false;
	}

	public void incluir(){
		System.out.println(">>I: N:["+this.nome+"] "+"L:["+this.login+"]");
		
		//
		exibirModoInicial = false;
		exibirModoCadastro = true;
		exibirModoExclusao = false;
		desabilitarFormulario = false;
	}
	
	public void salvar(){
		System.out.println(">>S: N:["+this.nome+"] "+"L:["+this.login+"]");
	}
	
	public void pesquisar(){
		System.out.println(">>P: N:["+this.nome+"] "+"L:["+this.login+"]");
	}
	
	public void visualizar(ActionEvent event){
		System.out.println(">>S: N:["+this.nome+"] "+"L:["+this.login+"]");
		
		//
		exibirModoInicial = false;
		exibirModoCadastro = true;
		exibirModoExclusao = false;
		desabilitarFormulario = true;
	}
	
	public void alterar(){
		System.out.println(">>E: N:["+this.nome+"] "+"L:["+this.login+"]");
		
		//
		exibirModoInicial = false;
		exibirModoCadastro = true;
		exibirModoExclusao = false;
		desabilitarFormulario = false;
	}

	public void excluir(){
		System.out.println(">>E: N:["+this.nome+"] "+"L:["+this.login+"]");
		
		//
		exibirModoInicial = true;
		exibirModoCadastro = false;
		exibirModoExclusao = false;
		desabilitarFormulario = true;
	}
	
	public void cancelar(){
		System.out.println(">>C: N:["+this.nome+"] "+"L:["+this.login+"]");
		
		//
		exibirModoInicial = true;
		exibirModoCadastro = false;
		exibirModoExclusao = false;
		desabilitarFormulario = true;
	}

/*gets e sets*/

}

Outra dúvida é: as validações via annotation são aplicadas para telas como esta?

Desde já agradeço.

Chiina

Richfaces tutorial 4

[quote]As with most Ajax frameworks, you should not attempt to append or delete elements on a page
using RichFaces Ajax, but should instead replace them. As such, elements that are rendered
conditionally should not be targeted in the render attributes for Ajax controls. For successful
updates, an element with the same identifier as in the response must exist on the page. If it is
necessary to append code to a page, include a placeholder for it (an empty element).[/quote]

Desculpe a ignorância, mas não é isto que estou fazendo?
Já que estou com os outputPanel fixos na tela, tendo apenas o conteudo destes re-renderizados dependendo das condições que necessito.

Não sei se estou usando componentes errados, mas minha intensão era justamente essa, manter uma área fixa na tela, como apenas o seu conteúdo sendo re-renderizado dinamicamente.

Chiina

Pelo que parece vc ta ADICIONADO/REMOVENDO elementos no DOM.
Aconselho vc a usar style visible false…deve funcionar, escondendo os elementos, mas não removendo-os no DOM.
Vc até pode usar assim e funcionar bem em alguns navegadores…mas não é indicado por apresentar comportamentos inesperados.