Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View Controller.java
1 2 3
if (len <= 0) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("You must enter a temperature"));
}
View Controller.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<div id="container">
<h:form id="convertForm">
<h:panelGrid columns="4">
<h:outputLabel for="tempFrom">Temperature:</h:outputLabel>
<h:inputText value="#{tempFrom}" id="tempFrom" />
<h:message for="tempFrom" errorClass="invalid" />
<h:commandButton id="add" value="Convert"
action="#{tempConvert.setTempFrom(tempFrom)}">
</h:commandButton>
</h:panelGrid>
</h:form>
<h:form id="response">
<h:panelGrid columns="2">
<h:outputLabel>Converts to:</h:outputLabel>
<h:outputLabel value="#{tempConvert.temperature}" />
</h:panelGrid>
</h:form>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.