MovieList.xhtml
5.59 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE composition 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:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich" template="/layout/template.xhtml">
<ui:define name="body">
<h:form id="movieSearch" styleClass="edit">
<rich:simpleTogglePanel label="Movie Search Filter" switchType="ajax">
<s:decorate template="/layout/display.xhtml">
<ui:define name="label">Director</ui:define>
<h:inputText id="director" value="#{movieList.movie.director}" />
</s:decorate>
<s:decorate template="/layout/display.xhtml">
<ui:define name="label">Title</ui:define>
<h:inputText id="title" value="#{movieList.movie.title}" />
</s:decorate>
<s:decorate template="/layout/display.xhtml">
<ui:define name="label">Match</ui:define>
<h:selectOneRadio id="logic"
value="#{movieList.restrictionLogicOperator}" styleClass="radio">
<f:selectItem itemLabel="All" itemValue="and" />
<f:selectItem itemLabel="Any" itemValue="or" />
</h:selectOneRadio>
</s:decorate>
</rich:simpleTogglePanel>
<div class="actionButtons">
<h:commandButton id="search" value="Search" action="/view/example/MovieList.xhtml" />
<s:button id="reset" value="Reset" includePageParams="false" />
</div>
</h:form>
<rich:panel>
<f:facet name="header">
Movie Search Results (#{empty movieList.resultList ? 0 : (movieList.paginated ? movieList.resultCount : movieList.resultList.size)})
</f:facet>
<div class="results" id="movieList">
<h:outputText
value="The movie search returned no results."
rendered="#{empty movieList.resultList}" /> <rich:dataTable
id="movieList" var="_movie" value="#{movieList.resultList}"
rendered="#{not empty movieList.resultList}">
<h:column>
<f:facet name="header">
<ui:include src="/layout/sort.xhtml">
<ui:param name="entityList" value="#{movieList}" />
<ui:param name="propertyLabel" value="Id" />
<ui:param name="propertyPath" value="movie.id" />
</ui:include>
</f:facet>
<h:outputText value="#{_movie.id}" />
</h:column>
<h:column>
<f:facet name="header">
<ui:include src="/layout/sort.xhtml">
<ui:param name="entityList" value="#{movieList}" />
<ui:param name="propertyLabel" value="Director" />
<ui:param name="propertyPath" value="movie.director" />
</ui:include>
</f:facet>
<h:outputText value="#{_movie.director}" />
</h:column>
<h:column>
<f:facet name="header">
<ui:include src="/layout/sort.xhtml">
<ui:param name="entityList" value="#{movieList}" />
<ui:param name="propertyLabel" value="Title" />
<ui:param name="propertyPath" value="movie.title" />
</ui:include>
</f:facet>
<h:outputText value="#{_movie.title}" />
</h:column>
<h:column>
<f:facet name="header">
<ui:include src="/layout/sort.xhtml">
<ui:param name="entityList" value="#{movieList}" />
<ui:param name="propertyLabel" value="Year" />
<ui:param name="propertyPath" value="movie.year" />
</ui:include>
</f:facet>
<h:outputText value="#{_movie.year}" />
</h:column>
<h:column>
<f:facet name="header">
<ui:include src="/layout/sort.xhtml">
<ui:param name="entityList" value="#{movieList}" />
<ui:param name="propertyLabel" value="Plot" />
<ui:param name="propertyPath" value="movie.plot" />
</ui:include>
</f:facet>
<h:outputText value="#{_movie.plot}" />
</h:column>
<rich:column styleClass="action">
<f:facet name="header">Action</f:facet>
<s:link view="/view/example/#{empty from ? 'Movie' : from}.xhtml"
value="#{empty from ? 'View' : 'Select'}"
propagation="#{empty from ? 'none' : 'default'}" id="movieViewId">
<f:param name="movieId" value="#{_movie.id}" />
</s:link>
#{' '}
<s:link view="/view/example/MovieEdit.xhtml" value="Edit"
propagation="none" id="movieEdit" rendered="#{empty from}">
<f:param name="movieId" value="#{_movie.id}" />
</s:link>
</rich:column>
</rich:dataTable></div>
</rich:panel>
<div class="tableControl">
<s:link view="/view/example/MovieList.xhtml"
rendered="#{movieList.previousExists}"
value="#{messages.left}#{messages.left} First Page" id="firstPage">
<f:param name="firstResult" value="0" />
</s:link>
<s:link view="/view/example/MovieList.xhtml"
rendered="#{movieList.previousExists}"
value="#{messages.left} Previous Page" id="previousPage">
<f:param name="firstResult" value="#{movieList.previousFirstResult}" />
</s:link>
<s:link view="/view/example/MovieList.xhtml" rendered="#{movieList.nextExists}"
value="Next Page #{messages.right}" id="nextPage">
<f:param name="firstResult" value="#{movieList.nextFirstResult}" />
</s:link>
<s:link view="/view/example/MovieList.xhtml" rendered="#{movieList.nextExists}"
value="Last Page #{messages.right}#{messages.right}" id="lastPage">
<f:param name="firstResult" value="#{movieList.lastFirstResult}" />
</s:link>
</div>
<s:div styleClass="actionButtons" rendered="#{empty from}">
<s:button view="/view/example/MovieEdit.xhtml" id="create" propagation="none"
value="Create movie">
<f:param name="movieId" />
</s:button>
</s:div>
</ui:define>
</ui:composition>