This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void setPaisRecebendoEmString(String paisEmTexto) { | |
| PaisesEnum[] paises = PaisesEnum.values(); | |
| for (PaisesEnum paisesEnum : paises) { | |
| if (paisEmTexto.equalsIgnoreCase(paisesEnum.toString())) { | |
| this.pais = paisesEnum; | |
| } | |
| } | |
| } | |
| public void setEstadoRecebendoEmString(String estadoEmTexto) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MACACO_AND_GURILA("Macaco","Gurila"), | |
| JACA_AND_ESCADA("Escada","Jaca"); | |
| private String tipoUm, tipoDois; | |
| private TiposEnum(String tipoUm, String tipoDois) { | |
| this.tipoUm = tipoUm; | |
| this.tipoDois = tipoDois; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ManagedBean(name="redBean") | |
| @SessionScoped | |
| public class Bean { | |
| private Integer opcao; | |
| private Boolean isRederiza = false; | |
| public Boolean getIsRederiza() { | |
| return isRederiza; | |
| } | |
| public Integer getOpcao() { | |
| return opcao; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h:form> | |
| <!-- aqui fica a declaração da tabela --> | |
| <p:dataTable id="tabela" value="#{meuBean.pessoas}" | |
| var="pessoa" | |
| paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {Exporters}" | |
| paginator="true" rows="10" style="margin-bottom:20px" | |
| rowStyleClass="#{pessoa.status == 'INATIVO' ? 'inativo-row' : null}" | |
| liveResize="true" emptyMessage="Nenhum Registro Encontrado"> | |
| <!-- aqui fica o select com os status da tebela --> | |
| <f:facet name="header"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <f:loadBundle basename="messages" var="msgs" /> | |
| <p:outputLabel value="Nome" for="nome" /> | |
| <p:inputText id="nome" value="#{seuBean.entidade.nome}" | |
| required="true" requiredMessage="#{msg.nomeBranco}"> | |
| <f:ajax event="blur" render="messageNome" /> | |
| <p:message for="nome" id="messageNome" /> | |
| </p:inputText> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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://xmlns.jcp.org/jsf/html" | |
| xmlns:f="http://xmlns.jcp.org/jsf/core" | |
| xmlns:p="http://primefaces.org/ui" | |
| xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> | |
| <h:head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class BaseBean implements Serializable { | |
| /** | |
| * | |
| */ | |
| private static final long serialVersionUID = 1L; | |
| public Date getMinAge() { | |
| Calendar currentDate = Calendar.getInstance(); | |
| currentDate.add(Calendar.YEAR, - DatasLimiteEnum.IdadeMinima.getIdadeNumeral()); | |
| logger.info("Min Age: " + currentDate.get(Calendar.MONTH) + "/" + currentDate.get(Calendar.DATE) + "/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p:outputLabel value="Cpf/CNPJ " for="cpf" /> | |
| <p:inputText id="cpf" value="#{seuBean.entitade.cpfCnpj}" | |
| maxlength="20" required="true" | |
| requiredMessage="Campo cpf não pode estar em branco" | |
| validatorMessage="CPF inválido"> | |
| <f:passThroughAttribute name="placeholder" value="Informe o seu CPF ou CNPJ" /> | |
| <f:validateRegex | |
| pattern="([0-9]{2}[\.]?[0-9]{3}[\.]?[0-9]{3}[\/]?[0-9]{4}[-]?[0-9]{2})|([0-9]{3}[\.]?[0-9]{3}[\.]?[0-9]{3}[-]?[0-9]{2})" /> | |
| <f:ajax event="blur" render="messageCpf" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p:outputLabel value="Senha" for="senha" /> | |
| <p:password id="senha" value="#{seuBean.entidade.senha}" | |
| feedback="true" | |
| required="true" | |
| requiredMessage="Campo senha não pode estar em branco" | |
| validatorMessage="Senha inválida" | |
| > | |
| <f:attribute name="type" value="password" /> | |
| <f:passThroughAttribute name="placeholder" value="No mímino 6 e no máximo 20 caracteres" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h:head> | |
| <h:outputScript library="js" name="locale-primefaces.js"/> | |
| </h:head> | |
| <p:outputLabel value="Data Nascimento" for="dataNacimento" /> | |
| <p:calendar id="dataNacimento" | |
| value="#{seuBean.entidade.dataNascimento}" | |
| showOn="button" | |
| pattern="dd-MM-yyyy" | |
| navigator="true" | |
| locale="pt_BR" |