Advertisement
Guest User

Untitled

a guest
Aug 16th, 2015
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. <?xml version='1.0' encoding='UTF-8' ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml"
  4. xmlns:h="http://xmlns.jcp.org/jsf/html"
  5. xmlns:f="http://xmlns.jcp.org/jsf/core">
  6. <h:head>
  7. <title>Data Table</title>
  8. </h:head>
  9. <h:body>
  10. <h:dataTable id="tabla" value="#{holaMundo.datos}" var="dato">
  11. <h:column>
  12. <f:facet name="header">
  13. <h:outputText value="valor"/>
  14. </f:facet>
  15. <h:outputText value="#{dato.valor}"/>
  16. </h:column>
  17. <h:column>
  18. <f:facet name="header">
  19. <h:outputText value="Nombre"/>
  20. </f:facet>
  21. <h:outputText value="#{dato.nombre}"/>
  22. </h:column>
  23. <h:column>
  24. <h:form>
  25. <h:commandButton id="btnBorrar" value="Borrar" action="#{holaMundo.removeValor(dato)}"/>
  26. </h:form>
  27. </h:column>
  28. </h:dataTable>
  29. <br/>
  30.  
  31. <h:form>
  32. <h:panelGrid columns="2">
  33. <h:outputLabel for="txtValor" value="Valor:"/>
  34. <h:inputText id="txtValor" value="#{dato.valor}" label="Valor" required="true"/>
  35.  
  36. <h:outputLabel for="txtNombre" value="Nombre:"/>
  37. <h:inputText id="txtNombre" value="#{dato.nombre}" label="Nombre" required="true"></h:inputText>
  38.  
  39. <h:outputLabel for="btnAgregar"/>
  40. <h:commandButton id="btnAgregar" action="#{holaMundo.addValor(dato)}" value="Añadir"/>
  41. </h:panelGrid>
  42. </h:form>
  43. </h:body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement