You are on page 1of 8

TRABAJO DE SEMANA SANTA

AUTORES:
SERGIO ANDRES ARDILA GONZALEZ

MATERIA:
INGENIERÍA DE SISTEMAS

PROGRAMACIÓN WEB

CORPORACIÓN UNIVERSITARIA DE CIENCIA Y DESARROLLO- UNICENCIA


BUCARAMANGA

2021
Login:
<!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"

xmlns:p="http://primefaces.org/ui">

<f:view contentType="text/html">

<h:head>

<f:facet name="first">

<meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>

<title>PrimeFaces</title>

</f:facet>

</h:head>

<h:body>

<h:form>

<p:panel header="Calcular Números" closable="true">

<p:panelGrid style="width: 100%" >

<p:row>

<p:column>

<p:outputLabel value="Número 1"></p:outputLabel>

</p:column>

<p:column>

<p:inputText value="#{indexFormBean.numero1}" ></p:inputText>

</p:column>
</p:row>

<p:row>

<p:column>

<p:outputLabel value="Número 2"></p:outputLabel>

</p:column>

<p:column>

<p:inputText value="#{indexFormBean.numero2}" ></p:inputText>

</p:column>

</p:row>

<p:row>

<p:column>

<p:outputLabel value="Número 3"></p:outputLabel>

</p:column>

<p:column>

<p:inputText value="#{indexFormBean.numero3}" ></p:inputText>

</p:column>

</p:row>

<p:row>

<p:column>

<p:outputLabel value="Total"></p:outputLabel>

</p:column>

<p:column>

<p:inputText value="#{indexFormBean.total}" ></p:inputText>

</p:column>

</p:row>

<p:row>
<p:column colspan="2">

<p:commandButton ajax="false" update="txtClave" value="Aceptar"


actionListener="#{indexFormBean.botonAceptar()}">

</p:commandButton>

<p:commandButton ajax="false" update="txtClave" value="Limpiar"


actionListener="#{indexFormBean.botonLimpiar()}">

</p:commandButton>

</p:column>

</p:row>

<p:row>

</p:row>

</p:panelGrid>

</p:panel>

</h:form>

</h:body>

</f:view>

</html>
Forbean
*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package edu.uniciencia.programacion.formularios;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
*
* @author system
*/
@ManagedBean
@ViewScoped
public class IndexFormBean {

private Integer numero1;


private Integer numero2;
private Integer numero3;
private Integer total;

public Integer getNumero1() {


return numero1;
}
public void setNumero1(Integer numero1) {
this.numero1 = numero1;
}

public Integer getNumero2() {


return numero2;
}

public void setNumero2(Integer numero2) {


this.numero2 = numero2;
}

public Integer getNumero3() {


return numero3;
}

public void setNumero3(Integer numero3) {


this.numero3 = numero3;
}

public Integer getTotal() {


return total;
}

public void setTotal(Integer total) {


this.total = total;
}
public void botonAceptar() {

int Vn1= this.getNumero1();


int Vn2= this.getNumero2();
int Vn3= this.getNumero3();

int c =(numero1 + numero2 + numero3)/3;


this.total=c;

public void botonLimpiar() {


this.numero1=0;
this.numero2=0;
this.numero3=0;
this.total=0;

/**
* Creates a new instance of IndexFormBean
*/
public IndexFormBean() {
}
}

You might also like