1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <!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:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <ui:composition template="/WEB-INF/layout/layout.xhtml"> <ui:define name="title">CD form</ui:define> <ui:define name="content"> <!-- use the form tag to set up this form --> <h:form id="cdForm"> ... ... ... </h:form> </ui:define> </ui:composition> </html> |
1 | <ui:composition template="/WEB-INF/layout/layout.xhtml"> |
1 | <ui:define name="title">CD form</ui:define> |
1 2 3 4 5 6 7 8 | <ui:define name="content"> <!-- use the form tag to setup this form --> <h:form id="cdForm"> ... ... ... </h:form> </ui:define> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | <h:dataTable id="items" value="#{CDManagerBean.cds}" var="cd" rowClasses="oddRow, evenRow" headerClass="tableHeader"> <!-- Title --> <h:column> <f:facet name="header"> <h:panelGroup> <hutputText value="Title" /> <f:verbatim>[</f:verbatim> <h:commandLink styleClass="smallLink" action="#{CDManagerBean.sort}"> <hutputText id="ascTitle" value="asc" /> <f:param name="by" value="title"/> <f:param name="order" value="asc"/> </h:commandLink> <hutputText value="," /> <!-- Sort descending --> <h:commandLink styleClass="smallLink" action="#{CDManagerBean.sort}"> <hutputText id="decTitle" value="dec" /> <f:param name="by" value="title"/> <f:param name="order" value="dec"/> </h:commandLink> <f:verbatim>]</f:verbatim> </h:panelGroup> </f:facet> <hutputText value="#{cd.title}" /> </h:column> <!-- Artist --> <h:column> <f:facet name="header"> <h:panelGroup> <hutputText value="Artist" /> <f:verbatim>[</f:verbatim> <h:commandLink styleClass="smallLink" action="#{CDManagerBean.sort}"> <hutputText id="ascArtist" value="asc" /> <f:param name="by" value="artist"/> <f:param name="order" value="asc"/> </h:commandLink> <hutputText value="," /> <!-- Sort descending --> <h:commandLink styleClass="smallLink" action="#{CDManagerBean.sort}"> <hutputText id="decArtist" value="dec" /> <f:param name="by" value="artist"/> <f:param name="order" value="dec"/> </h:commandLink> <f:verbatim>]</f:verbatim> </h:panelGroup> </f:facet> <h:outputText value="#{cd.artist}" /> </h:column> |
1 2 3 4 5 | <h:dataTable id="items" value="#{CDManagerBean.cds}" var="cd" rowClasses="oddRow, evenRow" headerClass="tableHeader"> <a:column entity="${cd}" fieldName="title" backingBean="${CDManagerBean}"/> <a:column entity="${cd}" fieldName="artist" backingBean="${CDManagerBean}"/> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | <!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:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:z="http://www.qualcomm.com/jsf/core" xmlns:c="http://java.sun.com/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions"> THIS TEXT WILL BE REMOVED <ui:composition> <!-- The label attribute is optional. Generate it if it is missing. --> <c:if test="${empty label}"> <c:set var="label" value="${fieldName}" /> </c:if> <!-- The sort attribute is optional. Set it to true if it is missing. --> <c:if test="${empty sort}"> <c:set var="sort" value="${true}" /> </c:if> <h:column> <f:facet name="header"> <h:panelGroup> ${label} <c:if test="${sort}"> [ <h:commandLink styleClass="smallLink" action="#{backingBean.sort}"> <h:outputText value="asc" /> <f:param name="by" value="${fieldName}"/> <f:param name="order" value="asc"/> </h:commandLink> , <!-- Sort descending --> <h:commandLink styleClass="smallLink" action="#{backingBean.sort}"> <h:outputText value="asc" /> <f:param name="by" value="${fieldName}"/> <f:param name="order" value="dec"/> </h:commandLink> ] </c:if> </h:panelGroup> </f:facet> <!-- Display the field name --> <h:outputText value="${entity[fieldName]}"/> </h:column> </ui:composition> THIS TEXT WILL BE REMOVED AS WELL </html> |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |