145 lines
8.5 KiB
Plaintext
Executable File
145 lines
8.5 KiB
Plaintext
Executable File
<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:c="http://java.sun.com/jstl/core"
|
|
xmlns:ui="http://java.sun.com/jsf/facelets"
|
|
xmlns:p="http://primefaces.org/ui"
|
|
xmlns:pe="http://primefaces.org/ui/extensions"
|
|
template="/WEB-INF/templates/template.xhtml"
|
|
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
|
|
<ui:define name="content">
|
|
<h:form id="formTable">
|
|
<maia:pageEvents controller="#{terminalController}"
|
|
queryProcess=":formTable:filters"
|
|
queryUpdate=":formTable:terminal"
|
|
focusContainer=":formTable:filters" />
|
|
|
|
<p:panelGrid id="filters" columns="9" styleClass="m-filters" >
|
|
<f:facet name="header">
|
|
<h:outputText value="#{msg_general.lbl_filters}" />
|
|
</f:facet>
|
|
<p:outputLabel for="branch" value="#{msg_general.lbl_branch}:" />
|
|
<p:selectOneMenu id="branch" value="#{terminalController.mfilters['branchcode']}" effect="fade"
|
|
style="width:150px">
|
|
<f:selectItem itemLabel="" itemValue="" />
|
|
<p:ajax listener="#{terminalController.loadOffice()}" update="office" event="change"/>
|
|
<f:selectItems value="#{terminalController.lbranch}" var="br" itemLabel="#{br.description}" itemValue="#{br.pk.branchcode}"/>
|
|
</p:selectOneMenu>
|
|
|
|
<p:outputLabel for="office" value="#{msg_general.lbl_office}:" />
|
|
<p:selectOneMenu id="office" value="#{terminalController.mfilters['officecode']}" effect="fade"
|
|
style="width:150px">
|
|
<f:selectItem itemLabel="" itemValue="" />
|
|
<f:selectItems value="#{terminalController.loffice}" var="of" itemLabel="#{of.description}" itemValue="#{of.pk.officecode}"/>
|
|
</p:selectOneMenu>
|
|
|
|
<p:outputLabel for="area" value="#{msg_general.lbl_area}:" />
|
|
<p:selectOneMenu id="area" value="#{terminalController.mfilters['areacode']}" effect="fade"
|
|
style="width:150px">
|
|
<f:selectItem itemLabel="" itemValue="" />
|
|
<f:selectItems value="#{terminalController.larea}" var="ar" itemLabel="#{ar.descripction}" itemValue="#{ar.pk.areacode}"/>
|
|
</p:selectOneMenu>
|
|
</p:panelGrid >
|
|
|
|
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
|
|
<maia:pageControls id="defaultControls" controller="#{terminalController}"
|
|
queryProcess=":formTable:filters"
|
|
queryUpdate=":formTable:filters :formTable:terminal"
|
|
createProcess=":formTable:filters"
|
|
createUpdate=":formProcess:pEdit"
|
|
dialogWidgetVar="dialog" />
|
|
</h:panelGrid>
|
|
|
|
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
|
|
<f:facet name="header">
|
|
<h:outputText value="#{msg_general.htbl_terminal}" />
|
|
</f:facet>
|
|
<p:dataTable id="terminal" var="row" value="#{terminalController.lrecord}" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
|
|
|
|
<p:column headerText="#{msg_general.lbl_terminal}" resizable="true" style="width:50px" sortBy="#{row.pk.terminalcode}">
|
|
<h:outputText value="#{row.pk.terminalcode}" />
|
|
</p:column>
|
|
<p:column headerText="#{msg_general.lbl_ipaddress}" resizable="true" style="width:150px" sortBy="#{row.ipaddress}">
|
|
<h:outputText value="#{row.ipaddress}" />
|
|
</p:column>
|
|
<p:column headerText="#{msg_general.lbl_macaddress}" resizable="true" style="width:50px" sortBy="#{row.macaddress}">
|
|
<h:outputText value="#{row.macaddress}" />
|
|
</p:column>
|
|
<p:column headerText="#{msg_general.lbl_printer}" resizable="true" style="width:50px" sortBy="#{row.sliptprinter}">
|
|
<h:outputText value="#{row.sliptprinter}" />
|
|
</p:column>
|
|
|
|
<p:column>
|
|
<p:commandButton value="#{msg_general.btn_edit}" update=":formProcess:pEdit" oncomplete="PF('dialog').show()" styleClass="m-action-button" icon="ui-icon-pencil" process="@this, :formTable:terminal">
|
|
<f:setPropertyActionListener target="#{terminalController.record}" value="#{row}" />
|
|
<f:setPropertyActionListener target="#{terminalController.showRow}" value="#{false}" />
|
|
<f:setPropertyActionListener target="#{terminalController.newRow}" value="#{false}" />
|
|
</p:commandButton>
|
|
</p:column>
|
|
<p:column>
|
|
<p:commandButton value="#{msg_general.btn_delete}" update=":formTable:terminal" styleClass="m-action-button" icon="ui-icon-trash" action="#{terminalController.remove()}" process="@this, :formTable:terminal">
|
|
<f:setPropertyActionListener target="#{terminalController.record}" value="#{row}" />
|
|
</p:commandButton>
|
|
</p:column>
|
|
|
|
|
|
</p:dataTable>
|
|
</p:panelGrid>
|
|
</h:form>
|
|
|
|
<p:dialog widgetVar="dialog" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)" showEffect="explode" hideEffect="explode"
|
|
styleClass="m-dialog">
|
|
<f:facet name="header">
|
|
<h:outputText value="#{msg_general.lbl_createoredit}" />
|
|
</f:facet>
|
|
<h:form id="formProcess">
|
|
<p:messages id="messages" autoUpdate="true" globalOnly="true"/>
|
|
<h:panelGrid id="pEdit" columns="4" >
|
|
|
|
<p:outputLabel for="terminal" value="#{msg_general.lbl_terminal}:" />
|
|
<p:spacer />
|
|
<h:outputText rendered="#{!terminalController.newRow}"
|
|
value="#{terminalController.record.pk.terminalcode}"/>
|
|
<p:inputText id="terminal"
|
|
rendered="#{terminalController.newRow}"
|
|
value="#{terminalController.record.pk.terminalcode}"
|
|
required="true" maxlength="15" style="width:120px" />
|
|
<p:message for="terminal" />
|
|
|
|
<p:outputLabel for="ip" value="#{msg_general.lbl_ipaddress}:" />
|
|
<pe:keyFilter for="ip" mask="num" />
|
|
<p:inputText id="ip"
|
|
value="#{terminalController.record.ipaddress}"
|
|
maxlength="15" style="width:120px" validatorMessage="Ip inválida">
|
|
<f:validateRegex pattern="^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$" for="ip"/>
|
|
</p:inputText>
|
|
<p:message for="ip" />
|
|
|
|
<p:outputLabel for="mac" value="#{msg_general.lbl_macaddress}:" />
|
|
<p:spacer />
|
|
<p:inputText id="mac"
|
|
value="#{terminalController.record.macaddress}"
|
|
maxlength="20" style="width:120px"/>
|
|
<p:message for="mac" />
|
|
|
|
<p:outputLabel for="printer" value="#{msg_general.lbl_printer}:" />
|
|
<p:spacer />
|
|
<p:inputText id="printer"
|
|
value="#{terminalController.record.sliptprinter}"
|
|
maxlength="50" style="width:400px"/>
|
|
<p:message for="printer" />
|
|
|
|
</h:panelGrid>
|
|
|
|
<h:panelGrid columns="2">
|
|
<maia:dialogControls controller="#{terminalController}"
|
|
process=":formProcess:pEdit"
|
|
update=":formProcess:pEdit, :formTable:terminal"
|
|
dialogWidgetVar="dialog" />
|
|
</h:panelGrid>
|
|
|
|
</h:form>
|
|
</p:dialog>
|
|
|
|
</ui:define>
|
|
</ui:composition> |