Pessoal
Sou iniciante no java ainda, estou no 4º semestre e não entendo muito bem de java, não dava muita atenção, mas agora ando apaixonado por JAVA… (principalmente depois que conheci o JSF)
Então, esse ainda é o meu primeiro ‘projeto’ era pra eu ter começado a fazer no início do semestre, mas bobiei como sempre e cá estou…no ‘desespero’
Estou fazendo um ‘estacionamento’ pra faculdade UNASP (Faculdade Adventista)
A mensagem de erro não some da tela, coloquei o f:validateLength e o required, e quando da erro, os erros não somem da tela, e vão somando mesmo atualizando a página (F5)
Por favor, quem puder colaborar eu agradeço muito
<?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://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<title>TED Parker!</title>
<h:outputStylesheet name="css/jsfcrud.css"/>
</h:head>
<h:body>
<div id="container">
<div id="header">
<h:link outcome="/index" value="#{bundle.ViewClienteIndexLink}"/> | <h:link outcome="/cliente/Create" value="Cadastrar Clientes"/> | <h:link outcome="/veiculo/Create" value="Cadastrar Veículos"/> | <h:link outcome="/estacionar/List" value="Estacionar"/>
</div>
<div id="content">
<ui:composition template="/template.xhtml">
<ui:define name="title">
<h:outputText value="#{bundle.CreateVeiculoTitle}"></h:outputText>
</ui:define>
<ui:define name="body">
<h:panelGroup id="messagePanel" layout="block">
<h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
</h:panelGroup>
<h:form>
<h:panelGrid columns="2">
<f:validateLength minimum="8" >
<h:outputLabel value="#{bundle.CreateVeiculoLabel_placa}" for="placa" />
<h:inputText id="placa" value="#{veiculoController.selected.placa}" title="#{bundle.CreateVeiculoTitle_placa}" maxlength="10" validatorMessage="Campo Placa Necessário" />
</f:validateLength>
<f:validateLength minimum="4" >
<h:outputLabel value="#{bundle.CreateVeiculoLabel_modelo}" for="modelo" />
<h:inputText id="modelo" value="#{veiculoController.selected.modelo}" title="#{bundle.CreateVeiculoTitle_modelo}" maxlength="20" validatorMessage="Campo Modelo Necessário" />
<h:outputLabel value="#{bundle.CreateVeiculoLabel_cor}" for="cor" />
<h:inputText id="cor" value="#{veiculoController.selected.cor}" title="#{bundle.CreateVeiculoTitle_cor}" maxlength="20" validatorMessage="Campo Cor Necessário" />
<h:outputLabel value="#{bundle.CreateVeiculoLabel_ano}" for="ano" />
<h:inputText id="ano" value="#{veiculoController.selected.ano}" title="#{bundle.CreateVeiculoTitle_ano}" maxlength="4" validatorMessage="Campo Ano Necessário" />
<!--<h:outputLabel value="#{bundle.CreateVeiculoLabel_id}" for="id" />
<h:inputText id="id" value="#{veiculoController.selected.id}" title="#{bundle.CreateVeiculoTitle_id}" />-->
</f:validateLength>
</h:panelGrid>
<br />
<h:commandLink action="#{veiculoController.create}" value="#{bundle.CreateVeiculoSaveLink}" />
<br />
<br />
<h:commandLink action="#{veiculoController.prepareList}" value="#{bundle.CreateVeiculoShowAllLink}" immediate="true"/>
<br />
<br />
</h:form>
</ui:define>
</ui:composition>
</div>
<div id="footer">
Todos os direitos Reservados®
</div>
</div>
</h:body>
</html>