maia_modificado/.svn/pristine/7a/7ab1a6ad3ebd52f09d21fb624e4...

97 lines
5.9 KiB
Plaintext
Executable File

<ui:composition
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:pe="http://primefaces.org/ui/extensions">
<h:form id="formPersonPhone">
<h:panelGrid columns="1" id="controls" styleClass="m-controls">
<p:commandButton value="#{msg_general.btn_create}" update=":formPerson:tabperson:formPhone:pEditPhone" oncomplete="PF('dialogPhone').show()" icon="ui-icon-plus"
action="#{peopleFastController.phones.create()}" process="@this">
</p:commandButton>
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_phones}" />
</f:facet>
<p:dataTable id="phones" var="row" value="#{peopleFastController.phones.lrecord}" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_general.lbl_phonetype}" resizable="true" sortBy="#{row.phonetypecatalog}">
<h:outputText value="#{row.modifiedData['phonetype']}" />
</p:column>
<p:column headerText="#{msg_general.lbl_area}" resizable="true" sortBy="#{row.areacode}">
<h:outputText value="#{row.areacode}" />
</p:column>
<p:column headerText="#{msg_general.lbl_numphone}" resizable="true" sortBy="#{row.phonenumber}">
<h:outputText value="#{row.phonenumber}" />
</p:column>
<p:column headerText="#{msg_general.lbl_numextension}" resizable="true" sortBy="#{row.extension}">
<h:outputText value="#{row.extension}" />
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_general.btn_edit}" update=":formPerson:tabperson:formPhone:pEditPhone" oncomplete="PF('dialogPhone').show()" styleClass="m-action-button" icon="ui-icon-pencil" process="@this, phones">
<f:setPropertyActionListener target="#{peopleFastController.phones.record}" value="#{row}" />
</p:commandButton>
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_general.btn_delete}" update=":formPerson:tabperson:formPersonPhone" styleClass="m-action-button"
icon="ui-icon-trash" action="#{peopleFastController.removePhone(row)}" process="@this, phones">
<f:setPropertyActionListener target="#{peopleFastController.phones.record}" value="#{row}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
<p:dialog widgetVar="dialogPhone" 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="formPhone">
<p:messages id="messages" autoUpdate="true" globalOnly="true"/>
<h:panelGrid id="pEditPhone" columns="4" bodyrows="1" >
<p:outputLabel for="phonetypecatalog" value="#{msg_general.lbl_phonetype}:" />
<pe:keyFilter/>
<p:selectOneMenu id="phonetypecatalog" value="#{peopleFastController.phones.record.phonetypecatalog}" var="p"
style="width:135px" panelStyle="width:135px" required="true">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{peopleFastController.phones.lphonetype}" var="id"
itemLabel="#{id.description}" itemValue="#{id.pk.catalog}" />
</p:selectOneMenu>
<p:message for="phonetypecatalog" />
<p:outputLabel for="areacode" value="#{msg_general.lbl_area}:" />
<pe:keyFilter for="areacode" mask="int"/>
<p:inputText id="areacode" value="#{peopleFastController.phones.record.areacode}"
maxlength="4" style="width:60px;" />
<p:message for="areacode" />
<p:outputLabel for="phonenumber" value="#{msg_general.lbl_numphone}:" />
<pe:keyFilter for="phonenumber" mask="int"/>
<p:inputText id="phonenumber"
value="#{peopleFastController.phones.record.phonenumber}"
maxlength="12" required="true"
style="width:120px;" />
<p:message for="phonenumber" />
<p:outputLabel for="extension" value="#{msg_general.lbl_numextension}:" />
<pe:keyFilter for="extension" mask="int"/>
<p:inputText id="extension" value="#{peopleFastController.phones.record.extension}"
maxlength="6" style="width:60px;" />
<p:message for="extension" />
</h:panelGrid>
<h:panelGrid columns="2" >
<p:commandButton value="#{msg_general.btn_update}" update=":formPerson:tabperson:formPersonPhone,:formPerson:tabperson:formPhone"
action="#{peopleFastController.phones.update()}" process="@this, pEditPhone"
icon="ui-icon-disk" oncomplete="if(args.validationFailed){return false;} PF('dialogPhone').hide()" />
<p:commandButton value="#{msg_general.btn_cancell}" oncomplete="PF('dialogPhone').hide()" icon="ui-icon-trash" process="@this" />
</h:panelGrid>
</h:form>
</p:dialog>
</ui:composition>