Created
June 19, 2018 13:30
-
-
Save nosrednawall/1435d796503009d222b97488c401cd37 to your computer and use it in GitHub Desktop.
renderiza telas xhtml primefaces
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; | |
| } | |
| public void setOpcao(Integer opcao) { | |
| this.opcao = opcao; | |
| } | |
| public void renderizar() { | |
| if(getOpcao().equals(1)){ | |
| isRederiza = true; | |
| } else { | |
| isRederiza = false; | |
| } | |
| } | |
| } |
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 id="form1"> | |
| <p:panel style="width:700px;"> | |
| <p:panelGrid id="grade" columns="1"> | |
| <h:selectOneRadio id="radio" value="#{redBean.opcao}" > | |
| <f:selectItem itemValue="1" itemLabel="Paciente" /> | |
| <f:selectItem itemValue="2" itemLabel="Secreária(o)" /> | |
| <f:selectItem itemValue="3" itemLabel="Nutricionista" /> | |
| <f:selectItem itemValue="4" itemLabel="Laboratório de Exames" /> | |
| <p:ajax listener="#{redBean.renderizar}" update=":form1:grade" /> | |
| </h:selectOneRadio> | |
| <p:fieldset id="pac" legend="Paciente Selecionado" rendered="#{redBean.isRederiza}"> | |
| <h:outputLabel value="Paciente"/> | |
| </p:fieldset> | |
| </p:panelGrid> | |
| </p:panel> | |
| </h:form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment