Upload
marcos-devaner
View
52
Download
3
Embed Size (px)
Citation preview
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:head> <title>Calcular Preço</title> </h:head> <h:body> <h:form> <h:panelGrid> <h:outputLabel value="Calcular Preço" style="font-size:25pt"/> <h:outputLabel value="Selecione o produto:" /> <h:selectOneMenu value="#{mBProduto.p.produto}"> <f:selectItems value="#{mBProduto.p.produtos}" var="produto" > </f:selectItems> </h:selectOneMenu> <h:outputLabel value="Quantidade:" for="qtd"/> <h:inputText value="#{mBProduto.p.qtd}" id="qtd" required="true" > <f:validateLongRange id="teste_qtd" minimum="1" maximum="1000"/> </h:inputText> <h:message for="teste_qtd" style="color:red"/> <h:message for="qtd" style="color:red"/> <h:outputLabel value="Preço:"/>
<h:inputText value="#{mBProduto.p.preco}" id="preco" required="true" > <f:validateDoubleRange id="teste_preco" minimum="0.1" maximum="1000.00"/> </h:inputText> <h:message for="teste_preco" style="color:red" /> <h:message for="preco" style="color:red"/> <h:commandButton value="Calcular" action="#{mBProduto.p.Calcular}"/> <h:outputLabel value="Produto selecionado:" /> <h:outputText value="#{mBProduto.p.produto}"/> <h:outputLabel value="Valor total:" /> <h:outputText value="#{mBProduto.p.resultado}"> <f:convertNumber local="pt_BR" type="currency"/> </h:outputText> </h:panelGrid> </h:form> </h:body> </html>