Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version='1.0' encoding='UTF-8' ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core">
- <h:head>
- <title>Data Table</title>
- </h:head>
- <h:body>
- <h:dataTable id="tabla" value="#{holaMundo.datos}" var="dato">
- <h:column>
- <f:facet name="header">
- <h:outputText value="valor"/>
- </f:facet>
- <h:outputText value="#{dato.valor}"/>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Nombre"/>
- </f:facet>
- <h:outputText value="#{dato.nombre}"/>
- </h:column>
- <h:column>
- <h:form>
- <h:commandButton id="btnBorrar" value="Borrar" action="#{holaMundo.removeValor(dato)}"/>
- </h:form>
- </h:column>
- </h:dataTable>
- <br/>
- <h:form>
- <h:panelGrid columns="2">
- <h:outputLabel for="txtValor" value="Valor:"/>
- <h:inputText id="txtValor" value="#{dato.valor}" label="Valor" required="true"/>
- <h:outputLabel for="txtNombre" value="Nombre:"/>
- <h:inputText id="txtNombre" value="#{dato.nombre}" label="Nombre" required="true"></h:inputText>
- <h:outputLabel for="btnAgregar"/>
- <h:commandButton id="btnAgregar" action="#{holaMundo.addValor(dato)}" value="Añadir"/>
- </h:panelGrid>
- </h:form>
- </h:body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement