Caelum Stella - Validator de CPF

0 respostas
S

Saudações,
Há tempos acompanho o fórum mas nunca tinha tomado coragem de postar algo, agora finalmente estou começando com um pequeno problema rs…
Fiz algumas tentivas de validar um número de cpf pelo Stella Faces usando JSF 2.0 mas não obtive sucesso. No código abaixo coloquei um validadeLength só pra descartar a possibilidade do problema ser na mensagem retornada. Já tentei colocar tanto true como false no formatted e simplesmente não acontece nada quando eu clico no botão… Estou usando as seguintes libs:

caelum-stella-faces-2.0-beta1
caelum-stella-bean-validation-2.0-beta1
caelum-stella-hibernate-user-types-2.0-beta1
caelum-stella-core-2.0-beta1

Ficarei muito grato se alguém puder me ajudar, segue aqui o código:

<?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: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:stella="http://stella.caelum.com.br/faces2">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
<h:body>
	<rich:panel>
		<h:form>
			<rich:messages ajaxRendered="true" id="mensagens" globalOnly="false">
			</rich:messages>
			<br />
			<h:outputText value="Nome:" />
			<h:inputText label="Nome" id="nome" required="true">
				<f:validateLength minimum="3" />
			</h:inputText>
			<br />
			<h:outputText value="CPF:" />
			<h:inputText>
				<stella:validateCPF formatted="true" />
			</h:inputText>
			<a4j:commandButton value="Gravar" render="painel" />
		</h:form>
	</rich:panel>
</h:body>
</html>

Abraços

Criado 4 de abril de 2012
Respostas 0
Participantes 1