This repository has been archived by the owner on Apr 30, 2023. It is now read-only.
/
view.jsp
129 lines (108 loc) · 2.44 KB
/
view.jsp
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<%@page import="java.util.List"%>
<%@page import="com.commsen.liferay.examples.portlet.servicebuilder.model.Player"%>
<%@page import="com.commsen.liferay.examples.portlet.servicebuilder.service.PlayerLocalServiceUtil"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/c" prefix="c" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@page import="com.liferay.portal.kernel.util.Constants"%>
<portlet:defineObjects />
<%
request.setAttribute("players", PlayerLocalServiceUtil.getAllPlayers());
%>
<b>Welcome to the Sample Service Builder Portlet!</b>
<br /><br />
<c:if test="${!empty players}">
<table class="lfr-table">
<tr>
<th>
ID
</th>
<th>
Name
</th>
<th>
Active
</th>
<th>
Score
</th>
<th>
Birthday
</th>
<th>
Description
</th>
</tr>
<c:forEach var="player" items="${players}">
<tr>
<td>
<c:out value="${player.playerId}" />
</td>
<td>
<c:out value="${player.name}" />
</td>
<td>
<c:out value="${player.active}" />
</td>
<td>
<c:out value="${player.score}" />
</td>
<td>
<c:out value="${player.birthday}" />
</td>
<td>
<c:out value="${player.description}" />
</td>
</tr>
</c:forEach>
</table>
<div class="separator"><!-- --></div>
</c:if>
<portlet:actionURL copyCurrentRenderParameters="true" portletMode="view" var="portletActionUrl" name="<%= Constants.ADD %>"/>
<form action="<c:out value="${portletActionUrl}" />" method="post" name="<portlet:namespace />fm" onSubmit="submitForm(document.<portlet:namespace />fm); return false;">
<table class="lfr-table">
<tr>
<td>
Name
</td>
<td>
<liferay-ui:input-field model="<%= Player.class %>" field="name" />
</td>
</tr>
<tr>
<td>
Active
</td>
<td>
<liferay-ui:input-field model="<%= Player.class %>" field="active" />
</td>
</tr>
<tr>
<td>
Score
</td>
<td>
<liferay-ui:input-field model="<%= Player.class %>" field="score" />
</td>
</tr>
<tr>
<td>
Birthday
</td>
<td>
<liferay-ui:input-date yearRangeEnd="2009" yearRangeStart="1900" dayParam="birthday_day" monthParam="birthday_month" yearParam="birthday_year"/>
</td>
</tr>
<tr>
<td>
Description
</td>
<td>
<liferay-ui:input-field model="<%= Player.class %>" field="description" />
</td>
</tr>
</table>
<br />
<input type="submit" value="<liferay-ui:message key="add" />" />
</form>