-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabricante.xhtml
164 lines (119 loc) · 5.39 KB
/
fabricante.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
template="/templates/modeloSistema.xhtml">
<ui:define name="menu">
<ui:include src="/includes/menuPrincipal.xhtml" />
</ui:define>
<ui:define name="conteudo">
<h:form id="frmFabListagem" onkeypress="if (event.keyCode == 13) {return false; }">
<p:dataTable id="tblFabricantes" widgetVar="tabelaFabricantes"
emptyMessage="Nenhum registro encontrado."
value="#{MBFabricante.itens}" var="item"
filteredValue="#{MBFabricante.itensFiltrados}"
paginator="true" rows="8">
<f:facet name="header">
Fabricante - Listagem
</f:facet>
<p:column headerText="Código" sortBy="{item.codigo}"
filterBy="#{item.codigo}">
<h:outputText value="#{item.codigo}" />
</p:column>
<p:column headerText="Descrição" sortBy="{item.codigo}"
filterBy="#{item.descricao}">
<h:outputText value="#{item.descricao}" />
</p:column>
<p:column headerText="Opções">
<p:commandButton icon="ui-icon-trash"
oncomplete="PF('dlgFabExcluir').show();"
update=":frmFabExcluir:pnlFabExcluir">
<f:setPropertyActionListener target="#{MBFabricante.fabricante}" value="#{item}" />
</p:commandButton>
<p:commandButton icon="ui-icon-pencil"
oncomplete="PF('dlgFabEditar').show();"
update=":frmFabEditar:pnlFabEditar" >
<f:setPropertyActionListener target="#{MBFabricante.fabricante}" value="#{item}" />
</p:commandButton>
</p:column>
<f:facet name="footer">
<p:commandButton value="Novo"
actionListener="#{MBFabricante.prepararNovo}"
oncomplete="PF('dlgFabNovo').show();"
update=":frmFabNovo:pnlFabNovo" />
</f:facet>
</p:dataTable>
</h:form>
<p:dialog widgetVar="dlgFabNovo" closable="false" draggable="false"
resizable="false" modal="true" appendTo="@(body)"
header="Fabricante - Novo">
<h:form id="frmFabNovo">
<h:panelGrid id="pnlFabNovo" columns="2">
<p:outputLabel for="txtDescFabNovo" value="Descrição:" />
<p:inputText id="txtDescFabNovo" size="30" maxlength="50"
value="#{MBFabricante.fabricante.descricao}"
required="true"
requiredMessage="O campo descrição é obrigatório." />
</h:panelGrid>
<h:panelGrid columns="2">
<p:commandButton value="Gravar"
actionListener="#{MBFabricante.novo}"
oncomplete="verificar(xhr, status, args, 'dlgFabNovo', 'tabelaFabricantes');"
update=":frmFabListagem:tblFabricantes :msgGlobal" />
<p:commandButton value="Cancelar" process="@this"
oncomplete="PF('dlgFabNovo').hide();">
<p:resetInput target="pnlFabNovo" />
</p:commandButton>
</h:panelGrid>
</h:form>
</p:dialog>
<p:dialog widgetVar="dlgFabExcluir" clasable="false" draggable="false"
resizable="false" modal="true" appendTo="@(body)"
header="Fabricante - Excluir">
<h:form id="frmFabExcluir">
<h:panelGrid id="pnlFabExcluir" columns="2">
<p:outputLabel value="Código:" />
<h:outputText value="#{MBFabricante.fabricante.codigo}" />
<h:outputText value="Descrição:" />
<h:outputText value="#{MBFabricante.fabricante.descricao}" />
</h:panelGrid>
<h:panelGrid columns="2">
<p:commandButton value="Excluir"
actionListener="#{MBFabricante.excluir}"
oncomplete="PF('dlgFabExcluir').hide(); tabelaFabricantes.clearFilters();"
update=":frmFabListagem:tblFabricantes :msgGlobal" />
<p:commandButton value="Cancelar" process="@this"
oncomplete="PF('dlgFabExcluir').hide();" />
</h:panelGrid>
</h:form>
</p:dialog>
<p:dialog widgetVar="dlgFabEditar" closable="false" draggable="false"
resizable="false" modal="true" appendTo="@(body)"
header="Fabricante - Editar">
<h:form id="frmFabEditar">
<h:panelGrid id="pnlFabEditar" columns="2">
<p:outputLabel value="Código" />
<h:outputText value="#{MBFabricante.fabricante.codigo}" />
<p:outputLabel for="txtDescProdEditar" value="Descrição" />
<p:inputText id="txtDescProdEditar" value="#{MBFabricante.fabricante.descricao}" size="30"
maxlength="50"
required="true"
requiredMessage="O campo descrição é obrigatório" />
</h:panelGrid>
<h:panelGrid columns="2">
<p:commandButton value="Editar"
actionListener="#{MBFabricante.editar}"
oncomplete="verificar(xhr, status, args, 'dlgFabEditar', 'tabelaFabricantes');"
update=":frmFabListagem:tblFabricantes :msgGlobal" />
<p:commandButton value="Cancelar" process="@this"
oncomplete="PF('dlgFabEditar').hide();">
<p:resetInput target="pnlFabEditar" />
</p:commandButton>
</h:panelGrid>
</h:form>
</p:dialog>
</ui:define>
</ui:composition>