Java Reference
In-Depth Information
rendered="#{game.number gt game.guess and
game.guess ne 0}"
style="color: red"/>
<h:outputText id="Lower" value="Lower!"
rendered="#{game.number lt game.guess and
game.guess ne 0}"
style="color: red"/>
</h:panelGrid>
Replace the string Number with the string Your Guess , so that the markup now looks
like this:
<h:panelGrid border="1" columns="5" style="font-size: 18px;">
Your Guess:
<h:inputText id="inputGuess" value="#{game.guess}"
required="true" size="3"
disabled="#{game.number eq game.guess}"
validator="#{game.validateNumberRange}">
</h:inputText>
<h:commandButton id="GuessButton" value="Guess"
action="#{game.check}"
disabled="#{game.number eq game.guess}"/>
<h:commandButton id="RestartButton" value="Reset"
action="#{game.reset}" immediate="true" />
<h:outputText id="Higher" value="Higher!"
rendered="#{game.number gt game.guess and
game.guess ne 0}" style="color: red"/>
<h:outputText id="Lower" value="Lower!"
rendered="#{game.number lt game.guess and
game.guess ne 0}" style="color: red"/>
</h:panelGrid>
Save the file, and without redeploying the application or reloading the page,
go back to the embedded browser window. Our change will be reflected on
the rendered page.
 
Search WWH ::




Custom Search