/
create.xhtml
57 lines (48 loc) · 1.64 KB
/
create.xhtml
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
54
55
56
57
<?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">
<ui:composition 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:c="http://java.sun.com/jsp/jstl/core@{metawidgetNamespaces}"
template="@{templateStrategy.getReferencePath(template != null ? template : templateStrategy.getDefaultTemplate())}">
<f:metadata>
<f:viewParam name="id" value="#{@{beanName}.id}"/>
<f:event type="preRenderView" listener="#{@{beanName}.retrieve}"/>
</f:metadata>
<ui:param name="pageTitle" value="Create @{entityName}"/>
<ui:define name="header">
@{entityName}
</ui:define>
<ui:define name="subheader">
<c:choose>
<c:when test="#{!empty @{beanName}.id}">
Edit existing @{entityName}
</c:when>
<c:otherwise>
Create a new @{entityName}
</c:otherwise>
</c:choose>
</ui:define>
<ui:define name="footer"/>
<ui:define name="main">
<h:form id="create">
<h:messages globalOnly="true" styleClass="error"/>
@{metawidget}
<div class="buttons">
<h:commandLink value="Save" action="#{@{beanName}.update}"/>
<c:choose>
<c:when test="#{!empty @{beanName}.id}">
<h:link value="Cancel" outcome="view">
<f:param name="id" value="#{@{beanName}.id}"/>
</h:link>
<h:commandLink value="Delete" action="#{@{beanName}.delete}"/>
</c:when>
<c:otherwise>
<h:link value="Cancel" outcome="search"/>
</c:otherwise>
</c:choose>
</div>
</h:form>
</ui:define>
</ui:composition>