-
Notifications
You must be signed in to change notification settings - Fork 0
/
acctypes-list.xhtml
147 lines (132 loc) · 9 KB
/
acctypes-list.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
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
<?xml version="1.0" encoding="UTF-8"?>
<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:p="http://primefaces.org/ui"
xmlns:adm="http://github.com/adminfaces"
template="#{layoutMB.template}">
<ui:define name="metadata">
<ui:param name="title" value="Account Types listing"/> <!-- Automatic create breadCrumb and page title when param 'title' is provided. -->
<style type="text/css">
.ui-datatable .ui-datatable-header {
text-align: right !important;
}
</style>
</ui:define>
<ui:define name="description">
Find Account Type by name or ID
</ui:define>
<ui:define name="body">
<h:form>
<p:focus context="@form"/>
<div class="box box-primary">
<div class="box-header with-border">
<div id="main-buttons" class="hidden-sm hidden-xs">
<!-- New Account Type Button -->
<p:commandButton action="/acctypes-form?faces-redirect=true" icon="fa fa-plus"
value="New" styleClass="btn-primary"/>
<p:spacer width="5"/>
<!-- Delete Selected Account Button -->
<p:commandButton value="Delete Selected" icon="fa fa-trash" styleClass="btn-danger"
action="#{accTypesListMB.delete}"
disabled="#{empty accTypesListMB.selectedPatients or accTypesListMB.selectedPatients.size() == 0}"
process="@this" update="@form"
>
<p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-danger"/>
</p:commandButton>
<p:spacer width="5"/>
<!-- View Selected Account Button -->
<p:commandButton value="View selected" update="@(.ui-dialog)" styleClass="btn-info"
disabled="#{empty accTypesListMB.selectedPatients or accTypesListMB.selectedPatients.size() == 0}"
oncomplete="PF('selectedPatients').show()" icon="fa fa-search"/>
</div>
<!-- Display for small screens such as mobile phone -->
<p:splitButton value="New" action="/acctypes-form?faces-redirect=true"
icon="fa fa-plus"
styleClass="hidden-md hidden-lg btn-primary">
<p:menuitem value="Delete Selected" action="#{accTypesListMB.delete}"
process="@this" update="@form"
disabled="#{empty accTypesListMB.selectedPatients or accTypesListMB.selectedPatients.size() == 0}"
icon="fa fa-trash">
<p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-danger"/>
</p:menuitem>
<p:menuitem value="View selected" update="@(.ui-dialog)"
oncomplete="PF('selectedPatients').show()"
disabled="#{empty accTypesListMB.selectedPatients or accTypesListMB.selectedPatients.size() == 0}"
icon="fa fa-search"
/>
</p:splitButton>
<p:separator/>
<p:dataTable widgetVar="patientsTable" var="c" value="#{accTypesListMB.patients}" rows="5"
rowKey="#{c.opno}" lazy="true" paginator="true"
filteredValue="#{accTypesListMB.filteredValue}"
paginatorPosition="bottom" selection="#{accTypesListMB.selectedPatients}"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {JumpToPageDropdown}"
currentPageReportTemplate="[ {startRecord} to {endRecord} of {totalRecords} ]"
rowsPerPageTemplate="5,10,15,20,30"
>
<p:ajax event="rowSelectCheckbox" update="@(.ui-button, .ui-confirm-dialog)"/>
<p:ajax event="rowUnselectCheckbox" update="@(.ui-button, .ui-confirm-dialog)"/>
<p:ajax event="rowSelect" update="@(.ui-button, .ui-confirm-dialog)"/>
<p:ajax event="rowUnselect" update="@(.ui-button, .ui-confirm-dialog)"/>
<f:facet name="header">
Find Account Type by ID#: <p:inputNumber id="inptId" decimalPlaces="0" thousandSeparator="" decimalSeparator="" value="#{accTypesListMB.opno}"/>
<p:spacer height="5"/>
<p:commandButton id="brFind"
value="Find"
action="#{accTypesListMB.findPatientById(accTypesListMB.opno)}"
process="@form"
update="@form"
styleClass="btn-flat bg-black btn-states"
partialSubmit="true"/>
</f:facet>
<p:column selectionMode="multiple" width="5%" styleClass="align-center"/>
<!-- Account Type ID Column -->
<p:column headerText="ID #" filterBy="#{c.opno}" sortBy="#{c.opno}"
filterMatchMode="contains">
<f:facet name="filter">
<p:autoComplete value="#{accTypesListMB.filter.entity.opno}" forceSelection="true"
minQueryLength="2" queryDelay="500" dropdown="true"
completeMethod="#{accTypesListMB.completeModelOpno}" maxResults="10">
<p:ajax event="itemSelect" process="@this" update="@none"
oncomplete="PF('patientsTable').filter()"/>
</p:autoComplete>
</f:facet>
<p:link value="#{c.opno}" outcome="/acctypes-form" >
<f:param name="opno" value="#{c.opno}"/>
</p:link>
</p:column>
<!-- Account Type Names Column -->
<p:column headerText="Names" filterBy="#{c.names}" sortBy="#{c.names}"
filterMatchMode="contains">
<f:facet name="filter">
<p:autoComplete value="#{accTypesListMB.filter.entity.names}" forceSelection="true"
minQueryLength="2" queryDelay="500" dropdown="true"
completeMethod="#{accTypesListMB.completeModel}" maxResults="10">
<p:ajax event="itemSelect" process="@this" update="@none"
oncomplete="PF('patientsTable').filter()"/>
</p:autoComplete>
</f:facet>
<p:link value="#{c.names}" outcome="/acctypes-form" >
<f:param name="names" value="#{c.names}"/>
</p:link>
</p:column>
</p:dataTable>
</div>
</div>
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade" styleClass="box-danger box-solid">
<p:commandButton value="Yes" type="button" styleClass="btn-material btn-primary ui-confirmdialog-yes"
icon="fa fa-check"/>
<p:commandButton value="No" type="button" styleClass="btn-material btn-danger ui-confirmdialog-no"
icon="fa fa-close"/>
</p:confirmDialog>
</h:form>
<p:dialog header="Selected Patients" widgetVar="selectedPatients" height="250"
width="400" responsive="true" styleClass="box-success">
<p:dataList id="selectedPatientsList" value="#{accTypesListMB.selectedPatients}" var="reception"
type="definition">
ID: #{reception.town}<br/>
NAME: #{reception.address}<br/>
</p:dataList>
</p:dialog>
</ui:define>
</ui:composition>